File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
packages/angular_devkit/build_angular/src/utils Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,17 @@ export async function process(options: ProcessBundleOptions): Promise<ProcessBun
118
118
let downlevelCode ;
119
119
let downlevelMap ;
120
120
if ( downlevel ) {
121
+ const { supportedBrowsers : targets = [ ] } = options ;
122
+
123
+ // todo: revisit this in version 10, when we update our defaults browserslist
124
+ // Without this workaround bundles will not be downlevelled because Babel doesn't know handle to 'op_mini all'
125
+ // See: https://github.com/babel/babel/issues/11155
126
+ if ( Array . isArray ( targets ) && targets . includes ( 'op_mini all' ) ) {
127
+ targets . push ( 'ie_mob 11' ) ;
128
+ } else if ( 'op_mini' in targets ) {
129
+ targets [ 'ie_mob' ] = '11' ;
130
+ }
131
+
121
132
// Downlevel the bundle
122
133
const transformResult = await transformAsync ( sourceCode , {
123
134
filename,
@@ -131,7 +142,7 @@ export async function process(options: ProcessBundleOptions): Promise<ProcessBun
131
142
require . resolve ( '@babel/preset-env' ) ,
132
143
{
133
144
// browserslist-compatible query or object of minimum environment versions to support
134
- targets : options . supportedBrowsers ,
145
+ targets,
135
146
// modules aren't needed since the bundles use webpack's custom module loading
136
147
modules : false ,
137
148
// 'transform-typeof-symbol' generates slower code
You can’t perform that action at this time.
0 commit comments