Webpack5 ESM strict mode
See original GitHub issueBug Report
Webpack5 beta.30
has enabled strict mode on the ESM modules imports https://github.com/webpack/webpack/releases/tag/v5.0.0-beta.30
https://github.com/webpack/webpack/issues/11467 has noted people with code problems, however @babel/runtime
appears to have code that doesn’t follow the strict "type": "module"
requirements, as expected for node / webpack.
.\node_modules\@babel\runtime\helpers\esm\package.json
has "type": "module"
being set and libraries that depend on @babel/runtime
with ESM modules are broken as a result.
I expect the code generator should be outputting with the file extensions to satisfy the requirements of ESM modules
https://nodejs.org/api/esm.html#esm_differences_between_es_modules_and_commonjs
Current behavior
@babel/runtime/helpers/esm/*.js contains extensionless imports for dependencies.
Expected behavior
@babel/runtime/helpers/esm/*.js to contain fully specified extensions for imports
Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
N/A - this is npm published module
Environment
System:
OS: Windows 10 10.0.19042
Binaries:
Node: 12.18.3 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.14.8 - C:\s\SwiftFox\node_modules\.bin\npm.CMD
Monorepos:
Yarn Workspaces: 1.22.5
npmPackages:
@babel/core: 7.11.4 => 7.11.4
babel-loader: 8.1.0 => 8.1.0
eslint: 7.7.0 => 7.7.0
webpack: 5.0.0-beta.30 => 5.0.0-beta.30
Issue Analytics
- State:
- Created 3 years ago
- Reactions:21
- Comments:14 (6 by maintainers)
We plan to release 7.12, which fixes this issue, the upcoming week.
@JLHwung Can we prioritize the problem?