Highlights
Improved HtmlRspackPlugin
rspack.HtmlRspackPlugin
has a lot of improvements to be more in line with the html-webpack-plugin
.
- [Feat] Support
hash
to append compilation hash - [Feat] Support
base
to inject base tag - [Feat] Support
scriptLoading=systemjs-module
- [Feat] Support
[templatehash]
in filename template, same as[contenthash]
- [Breaking] Rename
excludedChunks
toexcludeChunks
, aligned with html-webpack-plugin - [Breaking] Minify html by default when
mode=production
- [Fix] No doctype parsing error
- [Fix] Win32 relateive path
- [Fix] Relative favicon path
- [Fix] Wrong
&
escaping inscript.src
andlink.href
- [Test] Passed html-webpack-plugin basic cases from 45 to 85
PR: #7577
Removed SwcCssMinimizerRspackPlugin
The rspack.SwcCssMinimizerRspackPlugin
has been removed to reduce binary size, please use LightningCssMinimizerRspackPlugin instead:
module.exports = {
optimization: {
minimizer: [
- new rspack.SwcCssMinimizerRspackPlugin({
+ new rspack.LightningCssMinimizerRspackPlugin({
// options
}),
],
},
};
Rspack also supports using css-minimizer-webpack-plugin.
What's Changed
Breaking Changes 🛠
- feat!: improve HtmlRspackPlugin by @LingyuCoder in #7577
- refactor!: disable css minify in html minify and remove SwcCssMinimizerRspackPlugin by @ahabhgk in #7547
Performance Improvements ⚡
Exciting New Features 🎉
- feat: second param for loader hook by @SyMind in #7537
- feat(create-rspack): configure Lightning CSS targets by default by @chenjiahan in #7579
- feat(core): don't inject bundlerInfo in library mode by @hardfist in #7567
- feat: extract-css-plugin supports layer by @JSerFeng in #7583
Bug Fixes 🐞
- fix: use intersection runtime for concat module code gen by @ahabhgk in #7523
- fix: chunk hash unstable by @JSerFeng in #7534
- fix: should insert semi after import, export, debugger and class field by @CPunisher in #7529
- fix: check SuperProp in walk_call_expression by @CPunisher in #7530
- fix: remove useless "module" external runtime by @fi3ework in #7533
- fix(rust-core): no need to pass resolve_factory when using rust api by @hardfist in #7539
- fix(cli): wrong entry defaults from cli by @xc2 in #7541
- fix: source map plugin module should enable by default by @ahabhgk in #7545
- fix: avoid inner graph top level symbol for nested webpack_require by @ahabhgk in #7584
Document Updates 📖
- docs: correct property type style and filename by @chenjiahan in #7520
- docs: add overview flow chart for compiler hooks by @LingyuCoder in #7524
- docs: update benchmark data by @chenjiahan in #7548
- docs: correct LightningCssMinimizerRspackPlugin link by @JSerFeng in #7551
- docs: update chunk type by @h-a-n-a in #7552
- docs: list top50 plugins compatibility by @9aoy in #7554
- docs(module-federation): optimize module federation version selection by @zhoushaw in #7558
- docs: add overview flow chart for compilation hooks by @LingyuCoder in #7555
- docs: remove experiments flags by @hardfist in #7560
- docs: remove examples page by @9aoy in #7561
- docs: update glossary by @hardfist in #7562
- docs: delete benchmark page by @hardfist in #7566
- docs: upgrade Rspress version by @zoolsher in #7581
- docs: rewrite tree-shaking doc by @JSerFeng in #7568
Other Changes
- refactor(typescript): packages/rspack/src/node/NodeWatchFileSystem by @wxiaoyun in #7528
- chore(infra): improve the configuration of
justfile
by @shulaoda in #7526 - chore: polish some words on introduction by @hardfist in #7557
- chore(deps): update cargo-bins/cargo-binstall action to v1.10.2 by @renovate in #7564
- test(plugin): test html plugin with basic cases of html-webpack-plugin by @LingyuCoder in #7571
- chore(deps): bump plugin-react-refresh and lite-tapable to v1.0.0 by @chenjiahan in #7580
- refactor: improve esm harmony dependencies structure by @shulaoda in #7576
- refactor: module hash by @ahabhgk in #7569
Full Changelog: v1.0.0-beta.4...v1.0.0-beta.5