Core features
builtins.minifyOptions.extractComments
You could extract the license using the configuration below:
module.exports = {
// ... snip
builtins: {
minifyOptions: {
extractComments: true // by default, rspack will use regex `@preserve|@lic|@cc_on|^\**!`
}
}
}
or Using Regexp:
module.exports = {
// ... snip
builtins: {
minifyOptions: {
extractComments: /@license/
}
}
}
inline match resource
For more details you could refer https://webpack.js.org/api/loaders/#inline-matchresource
optimization.realContentHash
By default, when you use the contenthash
option in your output filename, Rspack will generate a hash based on the module's dependencies
and other factors that can change even if the module's content has not changed. This means that the bundle will be invalidated and rebuilt even if the module's content has not changed.
However, by enabling the optimization.realContentHash
option, Rspack
will generate a hash based only on the actual content of the module. This ensures that the bundle is invalidated and rebuilt only when the module's content has actually changed.
For more details you could refer to optimization.realContentHash
What's Changed
Exciting New Features 🎉
- feat: support experiments.css by @hardfist in #2930
- feat(cli): add --entry flags by @faga295 in #2902
- feat: add compatible compilation.modules by @IWANABETHATGUY in #2932
- feat: add comments in module code generation by @faga295 in #2893
- feat: asset resource side effects by @IWANABETHATGUY in #2849
- feat(new_split_chunks): support
splitChunks.minSize
by @hyf0 in #2954 - feat: support minifyoptions extract comments by @faga295 in #2882
- feat(create-rspack): add template react-ts by @wood3n in #2963
- feat(terser): expose terser options by @dgmachado in #2983
- feat(x.mjs): add
x clean
command by @Boshen in #2980 - feat(new_split_chunks): support
reuseExistingChunk
by @hyf0 in #3000 - feat(rspack): add ignoreWarnings option by @nagy-nabil in #2987
- feat(new_split_chunks): support
splitChunks.{cacheGroup}.minSize
by @hyf0 in #3015 - feat: support inline match resource by @h-a-n-a in #3017
- feat(new_split_chunks): support
splitChunks.name
by @hyf0 in #2955 - feat: simple normal module hook by @IWANABETHATGUY in #2446
- feat: allow to pass
false
tosplitChunks.name
andsplitChunks.{cacheGroup}.name
by @hyf0 in #3029 - feat(module factory): add before_resolve hook by @suxin2017 in #2940
- feat(rust): add output.sourceMapFilename core by @lippzhang in #3005
- feat: optimization.realContentHash by @ahabhgk in #2984
- feat(angular): adding initial support by @zackarychapple in #3009
- feat: optional-dependency by @suxin2017 in #3050
Bug Fixes 🐞
- fix: benchmark CI failed. by @IWANABETHATGUY in #2928
- fix: add missing
newSplitChunks
in schema.js by @hyf0 in #2934 - fix: require.resolve(Weak) should eval to true in if stmt test expr by @ahabhgk in #2935
- fix: should not reset
is_founded
inReactRefreshUsage
by @underfin in #2939 - fix: cannot reading
noEmitAssets
by @faga295 in #2942 - fix: hash chunkLoadingGlobal by @underfin in #2946
- fix: 🐛 use unknown module type in SWC by @JSerFeng in #2406
- fix(resolve): relative path resolve bug by @jerrykingxyz in #2952
- fix: 🐛 unexpected export warning by @IWANABETHATGUY in #2959
- fix: Fix type checking in config examples by @danielkoller in #2965
- fix(react-hmr): inject the runtime global function by @hyf0 in #2977
- fix: add entry startup to fix async script chunk loading by @underfin in #2966
- fix: entry startup for target node by @underfin in #3006
- fix: circular dependencies rebuild panic by @jerrykingxyz in #3001
- fix(core): fix require(
./xxx/xx.js
) failed by @hardfist in #3014 - fix(core): compatible with stats.version by @hardfist in #3016
- fix(new_split_chunks): should not care about
reuseExistingChunk
if name is specified forCacheGroup
by @hyf0 in #3045 - fix: 🐛 cross compile by @IWANABETHATGUY in #3059
- fix: css url generate with auto public path by @ahabhgk in #3061
- fix: already split module should connect chunk group at multiply entry by @underfin in #3057
- fix(resolve): bump nodejs-resolver to fix baseUrl bug in tsconfig by @bvanjoi in #3072
Other Changes
- chore: add hmr for loader example by @h-a-n-a in #2925
- chore(rust): bump rustc to v1.69.0 (nightly-2023-04-20) by @Boshen in #2903
- chore: add eslint support by @hardfist in #2904
- refactor(new_split_chunks): remove unused code and add more comments by @hyf0 in #2947
- chore: setup ./x script using zx by @Boshen in #2933
- refactor: clean up dependencies around swc for improving compile time by @Boshen in #2962
- refactor(plugin): asyncify
optimize_chunks
hook by @hyf0 in #2958 - chore(rust): bump dependencies by @Boshen in #2968
- ci: 🎡 trigger test when examples change by @IWANABETHATGUY in #2971
- refactor: extract comments by @IWANABETHATGUY in #2970
- refactor(split_chunks_new): asyncify
prepare_module_group_map
by @hyf0 in #2975 - chore: 🤖 disable css erorr by @IWANABETHATGUY in #2964
- docs: pnpm install command fix based on engine by @thedeveloperpotato in #2992
- refactor(core): use directory for chunk_graph module by @hyf0 in #2998
- chore: add node shims example by @hardfist in #2997
- test(split_chunks): add test of extract-css-to-single-chunk by @hyf0 in #2996
- chore: remove clap by @IWANABETHATGUY in #2967
- chore: add add loader_name to loader_sync_call in trace by @hardfist in #2999
- chore: fine grained tracing by @IWANABETHATGUY in #3002
- chore: make release profile the same for Cargo.toml and node_binding/Cargo.toml by @Boshen in #3004
- ci: remove manual symbol stripping from build steps by @Boshen in #3007
- chore: 🤖 bump napi cli by @IWANABETHATGUY in #3008
- chore: 🤖 recover check on save by @IWANABETHATGUY in #3013
- chore(rust): bump sass-embedded and remove protobuf requirement by @Boshen in #3021
- chore: link to rspack-dev-guide and make content more general in CONTRIBUTING.md by @Boshen in #3020
- refactor: external module for http request by @ahabhgk in #3023
- refactor: remove dependency parent module identifier by @underfin in #3024
- refactor(chunk_graph): split methods of
ChunkGraph
into different files by @hyf0 in #3031 - chore: 🤖 add alias cargo test no fail fast by @IWANABETHATGUY in #3032
- test(split_chunks): Migrate
test/configCases/split-chunks-common
of Webpack by @hyf0 in #3018 - refactor(rust): add more restriction clippy rules by @Boshen in #2974
- chore: 🤖 refactor before resolve by @IWANABETHATGUY in #3036
- refactor(new_split_chunks): use
RspackRegex
by @hyf0 in #3040 - ci: make pr and main use the same CI workflow by @Boshen in #3003
- refactor: 💡 angular support by @IWANABETHATGUY in #3055
- chore: take bump check temporarily by @hardfist in #3064
- chore: add stale bot, which only adds the "stale" label and never closes issues or PRs by @Boshen in #3065
New Contributors
- @danielkoller made their first contribution in #2965
- @wood3n made their first contribution in #2963
- @dgmachado made their first contribution in #2983
- @thedeveloperpotato made their first contribution in #2992
- @nagy-nabil made their first contribution in #2987
Full Changelog: v0.1.9...v0.1.10