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

Migrate to rspack #714

Merged
merged 5 commits into from
Oct 24, 2024
Merged

Migrate to rspack #714

merged 5 commits into from
Oct 24, 2024

Conversation

encounter
Copy link
Contributor

@encounter encounter commented Oct 24, 2024

This migrates from Webpack to Rspack, which provides a Webpack-compatible API with significant performance improvements. Given the API compatibility, a good portion of the Webpack configuration is unchanged, but I've combined the dev/prod configurations into one file, relying on NODE_ENV to disable/enable optimizations.

A full production build takes 10 seconds (~5s without type checking), and dev server rebuilds take ~100ms.

One incompatible piece was wasm-pack-plugin, so I modified the build scripts to run wasm-pack separately before running rspack. This means that changes to Rust files no longer auto-compile and reload. However, the dev server will still reload if pnpm run build:rust is executed manually, as it will detect changes to the imported rust/pkg files.

Edit: Added a pnpm run watch:rust script that can help with this.

@magcius magcius merged commit d9df2f6 into magcius:master Oct 24, 2024
1 check passed
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.

2 participants