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
118118 let downlevelCode ;
119119 let downlevelMap ;
120120 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+
121132 // Downlevel the bundle
122133 const transformResult = await transformAsync ( sourceCode , {
123134 filename,
@@ -131,7 +142,7 @@ export async function process(options: ProcessBundleOptions): Promise<ProcessBun
131142 require . resolve ( '@babel/preset-env' ) ,
132143 {
133144 // browserslist-compatible query or object of minimum environment versions to support
134- targets : options . supportedBrowsers ,
145+ targets,
135146 // modules aren't needed since the bundles use webpack's custom module loading
136147 modules : false ,
137148 // 'transform-typeof-symbol' generates slower code
You can’t perform that action at this time.
0 commit comments