Skip to content

Commit f1985e1

Browse files
alan-agius4Keen Yee Liau
authored and
Keen Yee Liau
committed
fix(@angular-devkit/build-angular): resolve @babel/preset-env
This is needed as otherwise under Bazel we hit `Cannot find module '@babel/preset-env` we use `require.resolve` since this is always patched under Bazel.
1 parent 41c63ea commit f1985e1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

packages/angular_devkit/build_angular/src/utils/process-bundle.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,15 @@ export async function process(options: ProcessBundleOptions): Promise<ProcessBun
126126
filename: options.filename,
127127
inputSourceMap: manualSourceMaps ? undefined : sourceMap,
128128
babelrc: false,
129-
// modules aren't needed since the bundles use webpack's custom module loading
130-
// 'transform-typeof-symbol' generates slower code
131-
presets: [['@babel/preset-env', { modules: false, exclude: ['transform-typeof-symbol'] }]],
129+
presets: [[
130+
require.resolve('@babel/preset-env'),
131+
{
132+
// modules aren't needed since the bundles use webpack's custom module loading
133+
modules: false,
134+
// 'transform-typeof-symbol' generates slower code
135+
exclude: ['transform-typeof-symbol'],
136+
},
137+
]],
132138
plugins: options.replacements ? [createReplacePlugin(options.replacements)] : [],
133139
minified: options.optimize,
134140
// `false` ensures it is disabled and prevents large file warnings

0 commit comments

Comments
 (0)