File tree 1 file changed +12
-1
lines changed
packages/angular_devkit/build_angular/src/utils
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
119
119
let downlevelCode ;
120
120
let downlevelMap ;
121
121
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
+
122
133
// Downlevel the bundle
123
134
const transformResult = await transformAsync ( sourceCode , {
124
135
filename,
@@ -132,7 +143,7 @@ export async function process(options: ProcessBundleOptions): Promise<ProcessBun
132
143
require . resolve ( '@babel/preset-env' ) ,
133
144
{
134
145
// browserslist-compatible query or object of minimum environment versions to support
135
- targets : options . supportedBrowsers ,
146
+ targets,
136
147
// modules aren't needed since the bundles use webpack's custom module loading
137
148
modules : false ,
138
149
// 'transform-typeof-symbol' generates slower code
You can’t perform that action at this time.
0 commit comments