Open TopGrd opened 1 year ago
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
@TopGrd can you help checkout whether this problem still exists using latest version
System Info
System Info System: OS: macOS 13.4.1 CPU: (8) x64 Apple M1 Memory: 33.23 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 16.20.0 - ~/git/nvs/default/bin/node Yarn: 1.22.19 - ~/.npm-global/bin/yarn npm: 8.10.0 - ~/.npm-global/bin/npm pnpm: 7.26.3 - ~/Library/pnpm/pnpm Browsers: Chrome: 115.0.5790.170 Chrome Canary: 118.0.5939.0 Safari: 16.5.1 npmPackages: @rspack/cli: latest => 0.2.11 @rspack/plugin-minify: ^0.1.12 => 0.1.12 @rspack/plugin-node-polyfill: latest => 0.1.12
Details
Build error when building with library and optimization config at the same time. Uncaught ReferenceError: require is not defined
But when I remove the optimization configuration, every thing is ok.
When configuring the optimization, M and P are assigned the value of an object, so the subsequent require logic is executed.![image](https://github.com/web-infra-dev/rspack/assets/4202848/ac8d9b05-2fb8-4549-aac6-f686286b0550)
When i remove the optimization config, module and exports is undefined, so the bottom logic is executed![image](https://github.com/web-infra-dev/rspack/assets/4202848/9f17f934-0293-47ff-82cb-265352f19483)
Reproduce link
https://github.com/TopGrd/rspack-umd-bug
Reproduce Steps
npm i npm run build serve ./dist