Bundler supports
Tracking the bundler supports for the optimal output (webpack1 and Rspack).
(ESM) Tree shakable export
(ESM) ESM export should be tree-shakable.
(ESM) ESM output won't break by scope isolation when bundling module bailout from concatenation.
(ESM) Remove unnecessary webpack exports runtime
(ESM) Force concatenation single module
(ESM) Externals
Externalized module import / dynamic import will introduce redundant runtime in webpack / Rspack. Dynamic import will be hoisted to the top level (webpack/webpack#17986). Furthermore, the import and import() should be leave unchanged.
(ESM) Avoid using namespace import for external module for better readability P0
(ESM) Dynamic import (Chunk splitting) P1
Static analysis is not possible due to the public path at runtime.
(ESM) Preserve CSS Import
(ESM) Node.js Shims
(CJS) Support static analyzable export.
(CJS / ESM) preserve require
require and require.resolve
(ESM) Re-export with property access or eval
(ESM) Multiple entries shares module graph
Multiple entries share the same module graph which will make bail out reason turn out to be a merge of all the entries and breaks the concatenation.
(ESM) Multiple entries P2
Export in library works only for last entry module
(ESM) Entry module demanding not to be bailed out.
non-Rslib related ESM feature support in Rspack
Bundler supports
Tracking the bundler supports for the optimal output (webpack1 and Rspack).
(ESM) Tree shakable export
(ESM) ESM export should be tree-shakable.
(ESM) ESM output won't break by scope isolation when bundling module bailout from concatenation.
(ESM) Remove unnecessary webpack exports runtime
(ESM) Force concatenation single module
(ESM) Externals
Externalized module import / dynamic import will introduce redundant runtime in webpack / Rspack. Dynamic import will be hoisted to the top level (webpack/webpack#17986). Furthermore, the
importandimport()should be leave unchanged.support
"module-import"external typeRspack misaligned: Port fix: only render init code when need moduleRemapping webpack/webpack#18338. However, the simple module remapping runtime in Rspack (https://github.com/web-infra-dev/rspack/blob/main/crates/rspack_core/src/external_module.rs#L266-L269) is totally unused now.
dynamic external introduce webpack runtime
In concatenated module, static external module namespace import re-assign breaks tree shaking (demo)
Not work with star export from external module (bundleless) Preserve star exports for externalized dependencies in module output webpack/webpack#15270
preserve
import()whenimport()is supported in that Node.js version in CJS. (BLOCK: can't distinguish static / dynamic from external callback except adding new information) Allow Dynamic Import in `commonjs2` webpack/webpack#16272(ESM) Avoid using namespace import for external module for better readability P0
(ESM) Dynamic import (Chunk splitting) P1
Static analysis is not possible due to the public path at runtime.
(ESM) Preserve CSS Import
(ESM) Node.js Shims
node-moduleshim rspack#7465(CJS) Support static analyzable export.
(CJS / ESM) preserve
requirerequireandrequire.resolverequire(...)should be either behave like esbuild (sniff and throw as a fallback) or be shimmed withcreateRequire.require.resolve(...)should be either behave like esbuild (sniff and throw as a fallback) or be shimmed withcreateRequire.require(...)with externals should work like__non_webpack_require__require.resolve(...)should preserve as-is.require('./' + expression + '.js')like dynamic require with expression. (BLOCK: https://github.com/microsoft/rushstack/blob/main/webpack/preserve-dynamic-require-plugin/README.md not available in Rspack assucceedModuleis readonly in JS side)(ESM) Re-export with property access or eval
(ESM) Multiple entries shares module graph
Multiple entries share the same module graph which will make bail out reason turn out to be a merge of all the entries and breaks the concatenation.
(ESM) Multiple entries P2
Export in library works only for last entry module
(ESM) Entry module demanding not to be bailed out.
"modern-module"'s ESM export premise.non-Rslib related ESM feature support in Rspack
Footnotes
Reference: https://github.com/webpack/webpack/issues/17121 ↩