@lynx-js/template-webpack-plugin@0.13.0
Minor Changes
-
Deduplicate lazy bundles: the same file imported via different paths (relative or alias) now produces a single bundle. (#2961)
Async chunk groups are grouped by the resolved module of their dynamic imports instead of the chunk name derived from the raw import request, so
./Foo.jsx,../Foo.jsxand@/Foo.jsxall load the sameasync/src/Foo.jsx.[fullhash].bundle, and a request that resolves above the compiler context no longer escapes theasync/directory. -
Stop injecting
webpackChunkNameinto dynamic imports so lazy bundle intermediate files stay inside the output directory. (#2961)The ReactLynx transform injected
webpackChunkName: "<request>-react__<layer>", so a dynamic import resolving above the compiler context (e.g.import('../../Foo.js')) leaked../into[name]/[id]and the intermediate js/css/hmr files escaped the output directory. Async chunks now keep rspack's own ids,__webpack_require__.lynx_acimaps them by chunk id, and each lazy bundle's intermediate JS and CSS are emitted under.rspeedy/async/<bundle-name>/<layer>.jsand<layer>.cssnext to its other intermediate outputs (tasm.json,debug-metadata.json, CSS hot-update files). ExplicitwebpackChunkNamecomments written by users are still honored and keep the user-controlled[name]placement. Main-thread chunks no longer emit CSS hot-update files — CSS only exists on the background thread, and the main-thread HMR runtime receives updates from it.These packages release together and must be upgraded together:
@lynx-js/react-webpack-pluginand@lynx-js/css-extract-webpack-pluginrequire@lynx-js/template-webpack-plugin^0.13.0, and@lynx-js/react-rsbuild-pluginrequires@lynx-js/react^0.123.0. -
Encode async lazy-bundle chunks with
customSections(main-thread / background / (#2584)
CSS) for thefetchBundleloader, and emit a per-chunkmodemap (empty maps
are skipped so no invalidundefined = {}is generated). Importing the same
bundle with conflictingsync/asyncmodes now fails the build with one error
per bundle, naming the import request and the importing modules, and falls back
tomode: 'async'until fixed.