-
-
Notifications
You must be signed in to change notification settings - Fork 600
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
exports is not defined #3939
Comments
can you help check the behavior of webpack? |
The webpack will render to
|
This is with an ESM output, correct? |
这个就是初始化的项目,没加其他的配置 @ScriptedAlchemy |
如果你的文件最终没有导出内容的话,构建工具会按 esm 处理,模块参数的第二项会是 webpack_exports 而不是 exports, webpack 也是这个逻辑,改一下你的 loader 中的模块化方案为 esm 就可以解决这个问题(当然为你的文件随便导出个啥让构建工具能知道你的文件类型是 commonjs 也可以 |
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! |
This should already been fixed by #6883 |
System Info
System:
OS: macOS 13.4.1
CPU: (10) arm64 Apple M1 Max
Memory: 7.44 GB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 16.15.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 8.5.5 - /usr/local/bin/npm
pnpm: 7.8.0 - /usr/local/bin/pnpm
Watchman: 2023.04.17.00 - /opt/homebrew/bin/watchman
Browsers:
Chrome: 115.0.5790.170
Safari: 16.5.2
npmPackages:
@rspack/cli: 0.2.11 => 0.2.11
Details
代码块中不能直接写 Object.defineProperty(exports, "__esModule", { value: true })
Reproduce link
No response
Reproduce Steps
The text was updated successfully, but these errors were encountered: