File tree 3 files changed +8
-4
lines changed
packages/angular_devkit/build_angular/src 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -428,6 +428,7 @@ export function buildWebpackBrowser(
428
428
const runtimeOptions = {
429
429
...processRuntimeAction ,
430
430
runtimeData : processResults ,
431
+ supportedBrowsers : buildBrowserFeatures . supportedBrowsers ,
431
432
} ;
432
433
processResults . push (
433
434
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 =
17
17
fullDifferentialEnv . toLowerCase ( ) !== 'false' ;
18
18
19
19
export class BuildBrowserFeatures {
20
- private readonly _supportedBrowsers : string [ ] ;
21
20
private readonly _es6TargetOrLater : boolean ;
21
+ readonly supportedBrowsers : string [ ] ;
22
22
23
23
constructor (
24
24
private projectRoot : string ,
25
25
private scriptTarget : ts . ScriptTarget ,
26
26
) {
27
- this . _supportedBrowsers = browserslist ( undefined , { path : this . projectRoot } ) ;
27
+ this . supportedBrowsers = browserslist ( undefined , { path : this . projectRoot } ) ;
28
28
this . _es6TargetOrLater = this . scriptTarget > ts . ScriptTarget . ES5 ;
29
29
}
30
30
@@ -59,7 +59,7 @@ export class BuildBrowserFeatures {
59
59
'ios_saf 10.3' ,
60
60
] ;
61
61
62
- return this . _supportedBrowsers . some ( browser => safariBrowsers . includes ( browser ) ) ;
62
+ return this . supportedBrowsers . some ( browser => safariBrowsers . includes ( browser ) ) ;
63
63
}
64
64
65
65
/**
@@ -77,7 +77,7 @@ export class BuildBrowserFeatures {
77
77
78
78
const data = feature ( features [ featureId ] ) ;
79
79
80
- return ! this . _supportedBrowsers
80
+ return ! this . supportedBrowsers
81
81
. some ( browser => {
82
82
const [ agentId , version ] = browser . split ( ' ' ) ;
83
83
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ export interface ProcessBundleOptions {
30
30
cacheKeys ?: ( string | undefined ) [ ] ;
31
31
integrityAlgorithm ?: 'sha256' | 'sha384' | 'sha512' ;
32
32
runtimeData ?: ProcessBundleResult [ ] ;
33
+ supportedBrowsers ?: string [ ] | Record < string , string > ;
33
34
}
34
35
35
36
export interface ProcessBundleResult {
@@ -111,6 +112,8 @@ export async function process(options: ProcessBundleOptions): Promise<ProcessBun
111
112
[
112
113
require . resolve ( '@babel/preset-env' ) ,
113
114
{
115
+ // browserslist-compatible query or object of minimum environment versions to support
116
+ targets : options . supportedBrowsers ,
114
117
// modules aren't needed since the bundles use webpack's custom module loading
115
118
modules : false ,
116
119
// 'transform-typeof-symbol' generates slower code
You can’t perform that action at this time.
0 commit comments