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 @@ -102,6 +102,17 @@ export async function process(options: ProcessBundleOptions): Promise<ProcessBun
102
102
let downlevelCode ;
103
103
let downlevelMap ;
104
104
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
+
105
116
// Downlevel the bundle
106
117
const transformResult = await transformAsync ( sourceCode , {
107
118
filename : options . filename ,
@@ -113,7 +124,7 @@ export async function process(options: ProcessBundleOptions): Promise<ProcessBun
113
124
require . resolve ( '@babel/preset-env' ) ,
114
125
{
115
126
// browserslist-compatible query or object of minimum environment versions to support
116
- targets : options . supportedBrowsers ,
127
+ targets,
117
128
// modules aren't needed since the bundles use webpack's custom module loading
118
129
modules : false ,
119
130
// 'transform-typeof-symbol' generates slower code
You can’t perform that action at this time.
0 commit comments