-
-
Notifications
You must be signed in to change notification settings - Fork 599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
commonjs: did not wrap minimized webpack output lib as format commonjs2 #935
Comments
githoniel
changed the title
commonjs: did not wrap webpack output lib as commonjs2
commonjs: did not wrap minimized webpack output lib as format commonjs2
Jul 13, 2021
webpack5 has change output like
still face the same problem |
githoniel
added a commit
to gem-mine/plugins
that referenced
this issue
Jul 16, 2021
githoniel
added a commit
to gem-mine/plugins
that referenced
this issue
Jul 19, 2021
…n defaultIsModuleExports = false(rollup#935)
guybedford
pushed a commit
that referenced
this issue
Jul 24, 2021
#942) * fix(commonjs): convert module.exports with `__esModule` property(#939) * test(commonjs): add test sample for cjs with esm-property * feat(commonjs): defaultIsModuleExports support module.exports * fix(commonjs): do not check right node in module.exports reassgin when defaultIsModuleExports = false(#935)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behavior
webpack-commonjs2.min.js
is minimize ofwebpack-commonjs2.js
in the reproduction repo. so they should both be wrapped bygetDefaultExportFromCjs
Actual Behavior
webpack-commonjs2.min.js
is not wrap bygetDefaultExportFromCjs
and will throw errorVM214:122 Uncaught TypeError: webpackCommonjs2_min is not a constructor
when executeAdditional Information
webpackBootstrap in
lib: commonjs2
is belowafter minimization it will be
the problem is
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
will get true before minimization but false after minimization inplugins/packages/commonjs/src/ast-utils.js
Lines 63 to 70 in 6867290
when
transformCommonjs
because of target is rename fromexports
toe
maybe we should revert #537 or just loose it by to not check
targetName === 'module'
The text was updated successfully, but these errors were encountered: