File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
packages/angular_devkit/build_angular/src Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -428,6 +428,7 @@ export function buildWebpackBrowser(
428428 const runtimeOptions = {
429429 ...processRuntimeAction ,
430430 runtimeData : processResults ,
431+ supportedBrowsers : buildBrowserFeatures . supportedBrowsers ,
431432 } ;
432433 processResults . push (
433434 await import ( '../utils/process-bundle' ) . then ( m => m . process ( runtimeOptions ) ) ,
Original file line number Diff line number Diff line change @@ -17,14 +17,14 @@ export const fullDifferential =
1717 fullDifferentialEnv . toLowerCase ( ) !== 'false' ;
1818
1919export class BuildBrowserFeatures {
20- private readonly _supportedBrowsers : string [ ] ;
2120 private readonly _es6TargetOrLater : boolean ;
21+ readonly supportedBrowsers : string [ ] ;
2222
2323 constructor (
2424 private projectRoot : string ,
2525 private scriptTarget : ts . ScriptTarget ,
2626 ) {
27- this . _supportedBrowsers = browserslist ( undefined , { path : this . projectRoot } ) ;
27+ this . supportedBrowsers = browserslist ( undefined , { path : this . projectRoot } ) ;
2828 this . _es6TargetOrLater = this . scriptTarget > ts . ScriptTarget . ES5 ;
2929 }
3030
@@ -59,7 +59,7 @@ export class BuildBrowserFeatures {
5959 'ios_saf 10.3' ,
6060 ] ;
6161
62- return this . _supportedBrowsers . some ( browser => safariBrowsers . includes ( browser ) ) ;
62+ return this . supportedBrowsers . some ( browser => safariBrowsers . includes ( browser ) ) ;
6363 }
6464
6565 /**
@@ -77,7 +77,7 @@ export class BuildBrowserFeatures {
7777
7878 const data = feature ( features [ featureId ] ) ;
7979
80- return ! this . _supportedBrowsers
80+ return ! this . supportedBrowsers
8181 . some ( browser => {
8282 const [ agentId , version ] = browser . split ( ' ' ) ;
8383
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ export interface ProcessBundleOptions {
3030 cacheKeys ?: ( string | undefined ) [ ] ;
3131 integrityAlgorithm ?: 'sha256' | 'sha384' | 'sha512' ;
3232 runtimeData ?: ProcessBundleResult [ ] ;
33+ supportedBrowsers ?: string [ ] | Record < string , string > ;
3334}
3435
3536export interface ProcessBundleResult {
@@ -111,6 +112,8 @@ export async function process(options: ProcessBundleOptions): Promise<ProcessBun
111112 [
112113 require . resolve ( '@babel/preset-env' ) ,
113114 {
115+ // browserslist-compatible query or object of minimum environment versions to support
116+ targets : options . supportedBrowsers ,
114117 // modules aren't needed since the bundles use webpack's custom module loading
115118 modules : false ,
116119 // 'transform-typeof-symbol' generates slower code
You can’t perform that action at this time.
0 commit comments