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

Speed up builds by not bundling typescript #398

Merged
merged 1 commit into from
Mar 20, 2024
Merged

Speed up builds by not bundling typescript #398

merged 1 commit into from
Mar 20, 2024

Conversation

justinfagnani
Copy link
Collaborator

This marks internal/typescript.js as internal in the worker Rollup config, and switches the worker to use modules so it can load the typescript module build.

playground-typescript-worker.js's size goes from 3034427 bytes to 39289 bytes, and the build time on my M1 Pro goes from 26.2s to 4.4s when the typescript bundle is already built.

Module worker support is very good now, at > 96% of tracked users: https://caniuse.com/mdn-api_worker_worker_ecmascript_modules

@justinfagnani justinfagnani requested a review from aomarks March 20, 2024 16:59
Copy link
Member

@aomarks aomarks left a comment

Choose a reason for hiding this comment

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

🎉

@aomarks aomarks merged commit 2712837 into main Mar 20, 2024
9 checks passed
@aomarks aomarks deleted the faster-build branch March 20, 2024 21:55
@tbroyer
Copy link

tbroyer commented Oct 16, 2024

This introduced an (unexpected?) breaking change: the internal/typescript.js now needs to be copied alongside the playground-typescript-worker.js, and when using Rollup with @web/rollup-plugin-import-meta-assets, it has to be manually copied to the assets folder (alongside the worker script that Rollup would have copied itself).

The README needs to be updated to reflect this. See #418

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.

3 participants