-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(@angular-devkit/build-webpack): correctly handle ESM webpack conf…
…igurations Previoiusly, we didn't correctly handle ESM configurations as the `import` was always downlevelled to `require` by TypeScript. Closes #22547 (cherry picked from commit cb73c0b)
- Loading branch information
1 parent
9b3b57a
commit 820ff2a
Showing
9 changed files
with
114 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
packages/angular_devkit/build_webpack/test/basic-app/webpack.config.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { resolve } from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
|
||
export default { | ||
mode: 'development', | ||
entry: resolve(fileURLToPath(import.meta.url), '../src/main.js'), | ||
module: { | ||
rules: [ | ||
// rxjs 6 requires directory imports which are not support in ES modules. | ||
// Disabling `fullySpecified` allows Webpack to ignore this but this is | ||
// not ideal because it currently disables ESM behavior import for all JS files. | ||
{ test: /\.[m]?js$/, resolve: { fullySpecified: false } }, | ||
], | ||
}, | ||
output: { | ||
path: resolve(fileURLToPath(import.meta.url), '../dist'), | ||
filename: 'bundle.js', | ||
}, | ||
}; |