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 @@ -102,6 +102,17 @@ export async function process(options: ProcessBundleOptions): Promise<ProcessBun
102102 let downlevelCode ;
103103 let downlevelMap ;
104104 if ( downlevel ) {
105+ const { supportedBrowsers : targets = [ ] } = options ;
106+
107+ // todo: revisit this in version 10, when we update our defaults browserslist
108+ // Without this workaround bundles will not be downlevelled because Babel doesn't know handle to 'op_mini all'
109+ // See: https://github.com/babel/babel/issues/11155
110+ if ( Array . isArray ( targets ) && targets . includes ( 'op_mini all' ) ) {
111+ targets . push ( 'ie_mob 11' ) ;
112+ } else if ( 'op_mini' in targets ) {
113+ targets [ 'ie_mob' ] = '11' ;
114+ }
115+
105116 // Downlevel the bundle
106117 const transformResult = await transformAsync ( sourceCode , {
107118 filename : options . filename ,
@@ -113,7 +124,7 @@ export async function process(options: ProcessBundleOptions): Promise<ProcessBun
113124 require . resolve ( '@babel/preset-env' ) ,
114125 {
115126 // browserslist-compatible query or object of minimum environment versions to support
116- targets : options . supportedBrowsers ,
127+ targets,
117128 // modules aren't needed since the bundles use webpack's custom module loading
118129 modules : false ,
119130 // 'transform-typeof-symbol' generates slower code
You can’t perform that action at this time.
0 commit comments