-
-
Notifications
You must be signed in to change notification settings - Fork 64
Closed
web-infra-dev/rspack
#8414Labels
Description
What problem does this feature solve?
Input
const { parse } = await import("acorn");Rslib CJS output
const { parse } = await Promise.resolve(/* import() */ ).then(__webpack_require__.t.bind(__webpack_require__, "acorn", 23));What expected
const { parse } = await import("acorn");We should support keep dynamic import in CJS output, thus avoid importing extra runtime code and keeping import existing.
What does the proposed API look like?
esbuild use supported and add an options dynamic-import to control it.
And in Modern.js Module, we deal like below
supported: {
'dynamic-import': buildType === 'bundle' || format !== 'cjs',
},Reactions are currently unavailable