Skip to content

Commit 69aa460

Browse files
alan-agius4Keen Yee Liau
authored and
Keen Yee Liau
committed
refactor(@angular-devkit/build-angular): remove deprecated es5BrowserSupport build option
BREAKING CHANGE Deprecated browser builder option `es5BrowserSupport` has been removed. The inclusion for ES5 polyfills will be determined from the browsers listed in the browserslist configuration.
1 parent 6263924 commit 69aa460

File tree

7 files changed

+1
-38
lines changed

7 files changed

+1
-38
lines changed

packages/angular/cli/lib/config/schema.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -950,11 +950,6 @@
950950
},
951951
"default": []
952952
},
953-
"es5BrowserSupport": {
954-
"description": "Enables conditionally loaded ES2015 polyfills.",
955-
"type": "boolean",
956-
"default": false
957-
},
958953
"rebaseRootRelativeCssUrls": {
959954
"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.",
960955
"type": "boolean",

packages/angular_devkit/build_angular/src/angular-cli-files/models/build-options.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ export interface BuildOptions {
6868
statsJson: boolean;
6969
forkTypeChecker: boolean;
7070
profile?: boolean;
71-
/** @deprecated since version 8 **/
72-
es5BrowserSupport?: boolean;
7371

7472
main: string;
7573
polyfills?: string;

packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/common.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,7 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
130130
tsConfig.options.target || ScriptTarget.ES5,
131131
);
132132

133-
if (
134-
buildOptions.es5BrowserSupport ||
135-
(buildOptions.es5BrowserSupport === undefined && buildBrowserFeatures.isEs5SupportNeeded())
136-
) {
133+
if (buildBrowserFeatures.isEs5SupportNeeded()) {
137134
const polyfillsChunkName = 'polyfills-es5';
138135
entryPoints[polyfillsChunkName] = [path.join(__dirname, '..', 'es5-polyfills.js')];
139136
if (differentialLoadingMode) {

packages/angular_devkit/build_angular/src/browser/schema.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,11 +350,6 @@
350350
"default": false,
351351
"x-deprecated": "Use \"NG_BUILD_PROFILING\" environment variable instead."
352352
},
353-
"es5BrowserSupport": {
354-
"description": "Enables conditionally loaded ES2015 polyfills.",
355-
"type": "boolean",
356-
"x-deprecated": "This will be determined from the list of supported browsers specified in the 'browserslist' file."
357-
},
358353
"rebaseRootRelativeCssUrls": {
359354
"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.",
360355
"type": "boolean",

packages/angular_devkit/build_angular/src/utils/webpack-browser-config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ export async function generateWebpackConfig(
8282
// Under downlevel differential loading we copy the assets outside of webpack.
8383
assets: [],
8484
esVersionInFileName: true,
85-
es5BrowserSupport: undefined,
8685
};
8786
}
8887

packages/schematics/angular/utility/workspace-models.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ export interface BrowserBuilderOptions extends BrowserBuilderBaseOptions {
6262
maximumWarning?: string;
6363
maximumError?: string;
6464
}[];
65-
es5BrowserSupport?: boolean;
6665
webWorkerTsConfig?: string;
6766
}
6867

tests/legacy-cli/e2e/tests/misc/support-ie.ts renamed to tests/legacy-cli/e2e/tests/misc/es5-polyfills.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ export default async function () {
99
compilerOptions['target'] = 'es5';
1010
});
1111

12-
await updateJsonFile('angular.json', workspaceJson => {
13-
const appArchitect = workspaceJson.projects['test-project'].architect;
14-
appArchitect.build.options.es5BrowserSupport = false;
15-
});
16-
1712
await writeFile('.browserslistrc', 'last 2 Chrome versions');
1813
await ng('build');
1914
await expectFileNotToExist('dist/test-project/polyfills-es5.js');
@@ -25,21 +20,6 @@ export default async function () {
2520
<script src="main.js" defer></script>
2621
`);
2722

28-
await ng('build', `--es5BrowserSupport`);
29-
await expectFileToMatch('dist/test-project/polyfills-es5.js', 'core-js');
30-
await expectFileToMatch('dist/test-project/index.html', oneLineTrim`
31-
<script src="runtime.js" defer></script>
32-
<script src="polyfills-es5.js" nomodule defer></script>
33-
<script src="polyfills.js" defer></script>
34-
<script src="styles.js" defer></script>
35-
<script src="vendor.js" defer></script>
36-
<script src="main.js" defer></script>
37-
`);
38-
39-
await updateJsonFile('angular.json', workspaceJson => {
40-
const appArchitect = workspaceJson.projects['test-project'].architect;
41-
appArchitect.build.options.es5BrowserSupport = undefined;
42-
});
4323
await writeFile('.browserslistrc', 'IE 10');
4424
await ng('build');
4525
await expectFileToMatch('dist/test-project/polyfills-es5.js', 'core-js');

0 commit comments

Comments
 (0)