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 @@ -119,6 +119,17 @@ export async function process(options: ProcessBundleOptions): Promise<ProcessBun
119119 let downlevelCode ;
120120 let downlevelMap ;
121121 if ( downlevel ) {
122+ const { supportedBrowsers : targets = [ ] } = options ;
123+
124+ // todo: revisit this in version 10, when we update our defaults browserslist
125+ // Without this workaround bundles will not be downlevelled because Babel doesn't know handle to 'op_mini all'
126+ // See: https://github.com/babel/babel/issues/11155
127+ if ( Array . isArray ( targets ) && targets . includes ( 'op_mini all' ) ) {
128+ targets . push ( 'ie_mob 11' ) ;
129+ } else if ( 'op_mini' in targets ) {
130+ targets [ 'ie_mob' ] = '11' ;
131+ }
132+
122133 // Downlevel the bundle
123134 const transformResult = await transformAsync ( sourceCode , {
124135 filename,
@@ -132,7 +143,7 @@ export async function process(options: ProcessBundleOptions): Promise<ProcessBun
132143 require . resolve ( '@babel/preset-env' ) ,
133144 {
134145 // browserslist-compatible query or object of minimum environment versions to support
135- targets : options . supportedBrowsers ,
146+ targets,
136147 // modules aren't needed since the bundles use webpack's custom module loading
137148 modules : false ,
138149 // 'transform-typeof-symbol' generates slower code
You can’t perform that action at this time.
0 commit comments