You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rspack uses the SwcJsMinimizerRspackPlugin by default to compress code, and you may need to configure the minimizerOptions to set module to true.
this is not the best solution since it will cause all js assets are treated module, you can control specific assets by set assetInfo
compilation.updateAsset(entry,newConcatSource(`export default function(global, globalThis, window, $app_exports$, $app_evaluate$){`,source,`}`),{javascriptModule:true// set this asset as module});
but rspack has some bugs about dealing with assetInfo, I'm gonna fix it
Rspack uses the SwcJsMinimizerRspackPlugin by default to compress code, and you may need to configure the minimizerOptions to set module to true.
this is not the best solution since it will cause all js assets are treated module, you can control specific assets by set assetInfo
compilation.updateAsset(entry,newConcatSource(`export default function(global, globalThis, window, $app_exports$, $app_evaluate$){`,source,`}`),{javascriptModule:true// set this asset as module});
but rspack has some bugs about dealing with assetInfo, I'm gonna fix it
System Info
system: macos 15.0
node: 20.16.0
Details
rspack.zip
操作步骤:
npm i
node pack.js
JavaScript parsing error: 'import', and 'export' cannot be used outside of module code
问题:
mode: "development"
正常mode: "production",
报错Reproduce link
No response
Reproduce Steps
see details
The text was updated successfully, but these errors were encountered: