Highlights
Support import.meta.glob
Rspack now supports import.meta.glob, a file-system import API already available in Vite and Turbopack. We chose to align with this ecosystem behavior.
const pages = import.meta.glob('./pages/**/*.tsx', {
eager: true,
import: 'default',
query: { layout: 'docs' },
base: './pages',
});More controllable CSS module parsing
CSS modules can now control parsing for @import, animations, custom idents, and dashed idents through module.parser, so projects can match existing CSS Modules behavior more closely while migrating to Rspack.
export default {
module: {
parser: {
'css/module': {
import: true,
animation: true,
customIdents: true,
dashedIdents: true,
},
},
},
};What's Changed
New Features 🎉
- feat(css): add supports import, animation, customIdents, and dashedIdents for CSS by @intellild in #14076
- feat: optimize generated getter for const export by @ahabhgk in #14045
- feat: implement import.meta.glob by @intellild in #13998
- feat: support import option for import.meta.glob by @intellild in #14123
- feat: support more import.meta.glob options by @intellild in #14129
- feat: inline const for default export by @ahabhgk in #14117
- feat: optimize getter for const export default by @ahabhgk in #14175
Performance 🚀
- perf: extend release opt-level s for cold-path crates by @hardfist in #14085
- perf: remove unnecessary async_trait usage by @hardfist in #14041
- perf: remove unused graph roots edge sorting by @intellild in #14101
- perf: reduce release binary size by @hardfist in #14103
- perf: reduce release binding size by @hardfist in #14108
- perf(javascript): reduce parser allocations by @hardfist in #14124
- perf: optimize find graph roots by @intellild in #14106
- perf: content into_string_lossy by @SyMind in #14121
- perf(core): use dense storage for dependency connections by @hardfist in #14148
- perf(resolver): reuse precomputed hash from rspack-resolver dependencies by @stormslowly in #14120
- perf(javascript): avoid cloning exports info during usage analysis by @hardfist in #14157
Bug Fixes 🐞
- fix(rsc): skip manifest runtime for worker entries by @SyMind in #14068
- fix: annotate generated JSON.parse as pure by @hardfist in #14110
- fix(rslib): align isolated dts diagnostics by @Timeless0911 in #14143
- fix(rspack_watcher): keep mtime baseline persistent across watch() cycles by @stormslowly in #14077
- fix(esm-library): split runtime chunk for async chunks by @JSerFeng in #14142
- fix: require swc helpers 0.5.22 by @JSerFeng in #14160
- fix(esm-library): move async runtime split logic by @JSerFeng in #14159
- fix(cli): block prototype-pollution payloads in --env parsing by @stormslowly in #14165
- fix: derive modern-module require external type from target by @JSerFeng in #14174
- fix: update peer dependency of @swc/helpers to ^0.5.23 by @JSerFeng in #14176
- fix: resolve external type in esm rendering by @JSerFeng in #14178
- fix: compat es5 for define property getters runtime by @ahabhgk in #14177
- fix(rstest): inject require.resolve origin by @9aoy in #14162
- fix(rstest): support new runtime template by @9aoy in #14181
Document 📖
- docs: add CSS module parser options by @intellild in #14096
- docs: split module config docs by @intellild in #14099
- docs: clarify module parser and generator options by @chenjiahan in #14111
- docs: align blog authors display with other rstack wbesite by @elecmonkey in #14125
- docs: invite @elecmonkey to Rspack core team by @chenjiahan in #14114
- docs: fix CSS module defaults by @intellild in #14136
- docs: document loader peer dependencies by @chenjiahan in #14137
- docs: document plugin peer dependencies by @chenjiahan in #14139
- docs(website): upgrade Tailwind CSS v4 with Rsbuild plugin by @chenjiahan in #14150
Other Changes
- test: remove jest-snapshot from test tools by @chenjiahan in #14112
- chore(deps): reduce peer dependency installs by @chenjiahan in #14115
- test: add swc-loader build module graph benchmark by @hardfist in #14128
- chore(deps): update patch npm dependencies by @renovate[bot] in #14132
- chore(deps): update dependency @module-federation/runtime-tools to v2.5.0 by @renovate[bot] in #14133
- test: satisfy socket.dev security by @intellild in #14138
- chore: upgrade swc_core from 66 to 67 by @hardfist in #14135
- revert: "feat: optimize generated getter for const export" by @ahabhgk in #14151
- revert: "revert: "feat: optimize generated getter for const export"" by @ahabhgk in #14153
- Revert "chore: upgrade swc_core from 66 to 67" by @JSerFeng in #14168
- Revert "fix: require swc helpers 0.5.22" by @JSerFeng in #14171
- chore(deps): upgrade pnpm to 11.3.0 by @chenjiahan in #14184
Full Changelog: v2.0.4...v2.0.5