Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): resolve @babel/preset-env
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alan-agius4 authored and Keen Yee Liau committed Dec 10, 2019
1 parent 1933ea5 commit 57d226a
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,15 @@ export async function process(options: ProcessBundleOptions): Promise<ProcessBun
filename: options.filename,
inputSourceMap: manualSourceMaps ? undefined : sourceMap,
babelrc: false,
// modules aren't needed since the bundles use webpack's custom module loading
// 'transform-typeof-symbol' generates slower code
presets: [['@babel/preset-env', { modules: false, exclude: ['transform-typeof-symbol'] }]],
presets: [[
require.resolve('@babel/preset-env'),
{
// modules aren't needed since the bundles use webpack's custom module loading
modules: false,
// 'transform-typeof-symbol' generates slower code
exclude: ['transform-typeof-symbol'],
},
]],
plugins: options.replacements ? [createReplacePlugin(options.replacements)] : [],
minified: options.optimize,
// `false` ensures it is disabled and prevents large file warnings
Expand Down

0 comments on commit 57d226a

Please sign in to comment.