Skip to content

Commit b994c24

Browse files
author
Angular Builds
committed
5fc1f24 feat(@angular-devkit/build-angular): deprecate es5BrowserSupport option in browser builder
1 parent ebdf8c0 commit b994c24

File tree

7 files changed

+27
-16
lines changed

7 files changed

+27
-16
lines changed

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"name": "@angular-devkit/build-angular",
3-
"version": "0.800.0-beta.14+3.86b23d7",
3+
"version": "0.800.0-beta.15+1.5fc1f24",
44
"description": "Angular Webpack Build Facade",
55
"experimental": true,
66
"main": "src/index.js",
77
"typings": "src/index.d.ts",
88
"builders": "builders.json",
99
"dependencies": {
10-
"@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#86b23d7",
11-
"@angular-devkit/build-optimizer": "github:angular/angular-devkit-build-optimizer-builds#86b23d7",
12-
"@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#86b23d7",
13-
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#86b23d7",
14-
"@ngtools/webpack": "github:angular/ngtools-webpack-builds#86b23d7",
10+
"@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#5fc1f24",
11+
"@angular-devkit/build-optimizer": "github:angular/angular-devkit-build-optimizer-builds#5fc1f24",
12+
"@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#5fc1f24",
13+
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#5fc1f24",
14+
"@ngtools/webpack": "github:angular/ngtools-webpack-builds#5fc1f24",
1515
"ajv": "6.10.0",
1616
"autoprefixer": "9.5.1",
1717
"browserslist": "4.5.4",

src/angular-cli-files/models/webpack-configs/common.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const CopyWebpackPlugin = require("copy-webpack-plugin");
1212
const path = require("path");
1313
const ts = require("typescript");
1414
const webpack_1 = require("webpack");
15+
const differential_loading_1 = require("../../../utils/differential-loading");
1516
const bundle_budget_1 = require("../../plugins/bundle-budget");
1617
const cleancss_webpack_plugin_1 = require("../../plugins/cleancss-webpack-plugin");
1718
const scripts_webpack_plugin_1 = require("../../plugins/scripts-webpack-plugin");
@@ -44,20 +45,26 @@ function getCommonConfig(wco) {
4445
entryPoints['main'] = [path.resolve(root, buildOptions.main)];
4546
}
4647
const es5Polyfills = path.join(__dirname, '..', 'es5-polyfills.js');
47-
if (buildOptions.es5BrowserSupport) {
48-
entryPoints['polyfills.es5'] = [es5Polyfills];
49-
if (!buildOptions.aot) {
50-
entryPoints['polyfills.es5'].push(path.join(__dirname, '..', 'es5-jit-polyfills.js'));
51-
}
52-
}
53-
if (buildOptions.es5BrowserSupport === undefined) {
48+
const es5JitPolyfills = path.join(__dirname, '..', 'es5-jit-polyfills.js');
49+
if (targetInFileName) {
50+
// For differential loading we don't need to have 2 polyfill bundles
5451
if (buildOptions.scriptTargetOverride === ts.ScriptTarget.ES2015) {
5552
entryPoints['polyfills'] = [path.join(__dirname, '..', 'safari-nomodule.js')];
5653
}
5754
else {
5855
entryPoints['polyfills'] = [es5Polyfills];
5956
if (!buildOptions.aot) {
60-
entryPoints['polyfills'].push(path.join(__dirname, '..', 'es5-jit-polyfills.js'));
57+
entryPoints['polyfills'].push(es5JitPolyfills);
58+
}
59+
}
60+
}
61+
else {
62+
// For NON differential loading we want to have 2 polyfill bundles
63+
if (buildOptions.es5BrowserSupport
64+
|| (buildOptions.es5BrowserSupport === undefined && differential_loading_1.isEs5SupportNeeded(projectRoot))) {
65+
entryPoints['polyfills.es5'] = [es5Polyfills];
66+
if (!buildOptions.aot) {
67+
entryPoints['polyfills.es5'].push(es5JitPolyfills);
6168
}
6269
}
6370
}

src/browser/schema.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ export interface Schema {
3737
deployUrl?: string;
3838
/**
3939
* Enables conditionally loaded ES2015 polyfills.
40+
* @deprecated This will be determined from the list of supported browsers specified in the
41+
* 'browserslist' file.
4042
*/
4143
es5BrowserSupport?: boolean;
4244
/**

src/browser/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@
308308
"es5BrowserSupport": {
309309
"description": "Enables conditionally loaded ES2015 polyfills.",
310310
"type": "boolean",
311-
"default": false
311+
"x-deprecated": "This will be determined from the list of supported browsers specified in the 'browserslist' file."
312312
},
313313
"rebaseRootRelativeCssUrls": {
314314
"description": "Change root relative URLs in stylesheets to include base HREF and deploy URL. Use only for compatibility and transition. The behavior of this option is non-standard and will be removed in the next major release.",

src/utils/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88
export * from './default-progress';
99
export * from './delete-output-dir';
10+
export * from './differential-loading';
1011
export * from './run-module-as-observable-fork';
1112
export * from './normalize-file-replacements';
1213
export * from './normalize-asset-patterns';

src/utils/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ function __export(m) {
1212
Object.defineProperty(exports, "__esModule", { value: true });
1313
__export(require("./default-progress"));
1414
__export(require("./delete-output-dir"));
15+
__export(require("./differential-loading"));
1516
__export(require("./run-module-as-observable-fork"));
1617
__export(require("./normalize-file-replacements"));
1718
__export(require("./normalize-asset-patterns"));

uniqueId

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Tue Apr 16 2019 14:23:33 GMT+0000 (Coordinated Universal Time)
1+
Tue Apr 16 2019 16:12:12 GMT+0000 (Coordinated Universal Time)

0 commit comments

Comments
 (0)