Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: move from ncc to tsup for create-waku #974

Merged
merged 6 commits into from
Oct 19, 2024

Conversation

tylersayshi
Copy link
Contributor

It looks like a bundler is needed for helping to minify the published code and transpile from typescript.

I've had a good personal experience with tsup and I saw @himself65 mention it, so figured I'd make this PR to help :)

Closes #973

Copy link

vercel bot commented Oct 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
waku ⬜️ Ignored (Inspect) Visit Preview Oct 18, 2024 4:27pm

Copy link

codesandbox-ci bot commented Oct 18, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

"compile": "rm -rf template dist *.tsbuildinfo && pnpm run template && pnpm run build",
"template": "cp -r ../../examples template && rm -rf template/*/dist && rm -rf template/*/node_modules && (for d in template/*; do mv $d/.gitignore $d/gitignore || true; done)",
"build": "ncc build ./src/index.ts -o ./dist/ --minify --no-cache --no-source-map-register"
"build": "tsup ./src/index.ts --minify --format esm"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use tsup.config.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure! changed 👍

@dai-shi dai-shi merged commit 159a07f into dai-shi:main Oct 19, 2024
24 checks passed
@dai-shi
Copy link
Owner

dai-shi commented Oct 19, 2024

Ahh, I should have asked before merging.

Do we still need this hack?

// keep original require to avoid
// bundling the whole package.json by `@vercel/ncc`
const packageJson = createRequire(import.meta.url)('../package.json');

dai-shi added a commit that referenced this pull request Oct 21, 2024
follow up to this:
#974 (comment)

---------

Co-authored-by: Tyler <tyler@secondspectrum.com>
Co-authored-by: daishi <daishi@axlight.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(create-waku): avoid ncc
3 participants