Skip to content

feat(@angular-devkit/build-angular): change es5BrowserSupport output filename to polyfills.es5.js #13809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function getBrowserConfig(wco: WebpackConfigOptions) {
entrypoints: generateEntryPoints(buildOptions),
deployUrl: buildOptions.deployUrl,
sri: buildOptions.subresourceIntegrity,
noModuleEntrypoints: ['es2015-polyfills'],
noModuleEntrypoints: ['polyfills.es5'],
}));
}

Expand Down Expand Up @@ -113,7 +113,7 @@ export function getBrowserConfig(wco: WebpackConfigOptions) {
const moduleName = module.nameForCondition ? module.nameForCondition() : '';

return /[\\/]node_modules[\\/]/.test(moduleName)
&& !chunks.some(({ name }) => name === 'polyfills' || name === 'es2015-polyfills'
&& !chunks.some(({ name }) => name === 'polyfills' || name === 'polyfills.es5'
|| globalStylesBundleNames.includes(name));
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
}

if (buildOptions.es5BrowserSupport) {
entryPoints['es2015-polyfills'] = [path.join(__dirname, '..', 'es2015-polyfills.js')];
entryPoints['polyfills.es5'] = [path.join(__dirname, '..', 'es2015-polyfills.js')];
}

if (buildOptions.polyfills) {
Expand All @@ -68,8 +68,8 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
];

if (buildOptions.es5BrowserSupport) {
entryPoints['es2015-polyfills'] = [
...entryPoints['es2015-polyfills'],
entryPoints['polyfills.es5'] = [
...entryPoints['polyfills.es5'],
path.join(__dirname, '..', 'es2015-jit-polyfills.js'),
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function generateEntryPoints(
};

const entryPoints = [
'es2015-polyfills',
'polyfills.es5',
'polyfills',
'sw-register',
...extraEntryPoints(appConfig.styles, 'styles'),
Expand Down
2 changes: 1 addition & 1 deletion tests/legacy-cli/e2e/tests/basic/scripts-array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default function () {
// index.html lists the right bundles
.then(() => expectFileToMatch('dist/test-project/index.html', oneLineTrim`
<script src="runtime.js"></script>
<script src="es2015-polyfills.js" nomodule></script>
<script src="polyfills.es5.js" nomodule></script>
<script src="polyfills.js"></script>
<script src="scripts.js"></script>
<script src="renamed-script.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion tests/legacy-cli/e2e/tests/basic/styles-array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function () {
`))
.then(() => expectFileToMatch('dist/test-project/index.html', oneLineTrim`
<script src="runtime.js"></script>
<script src="es2015-polyfills.js" nomodule></script>
<script src="polyfills.es5.js" nomodule></script>
<script src="polyfills.js"></script>
<script src="vendor.js"></script>
<script src="main.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions tests/legacy-cli/e2e/tests/build/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default async function () {
await expectFileToMatch('dist/test-project/polyfills.js', 'zone.js');
expectFileToMatch('dist/test-project/index.html', oneLineTrim`
<script src="runtime.js"></script>
<script src="es2015-polyfills.js" nomodule></script>
<script src="polyfills.es5.js" nomodule></script>
<script src="polyfills.js"></script>
`);
const jitPolyfillSize = await getFileSize('dist/test-project/polyfills.js');
Expand All @@ -28,7 +28,7 @@ export default async function () {
await expectFileToMatch('dist/test-project/polyfills.js', 'zone.js');
expectFileToMatch('dist/test-project/index.html', oneLineTrim`
<script src="runtime.js"></script>
<script src="es2015-polyfills.js" nomodule></script>
<script src="polyfills.es5.js" nomodule></script>
<script src="polyfills.js"></script>
`);
}
4 changes: 2 additions & 2 deletions tests/legacy-cli/e2e/tests/build/styles/extract-css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function () {
`)))
.then(() => expectFileToMatch('dist/test-project/index.html', oneLineTrim`
<script src="runtime.js"></script>
<script src="es2015-polyfills.js" nomodule></script>
<script src="polyfills.es5.js" nomodule></script>
<script src="polyfills.js"></script>
<script src="vendor.js"></script>
<script src="main.js"></script>
Expand All @@ -64,7 +64,7 @@ export default function () {
// index.html lists the right bundles
.then(() => expectFileToMatch('dist/test-project/index.html', oneLineTrim`
<script src="runtime.js"></script>
<script src="es2015-polyfills.js" nomodule></script>
<script src="polyfills.es5.js" nomodule></script>
<script src="polyfills.js"></script>
<script src="styles.js"></script>
<script src="renamed-style.js"></script>
Expand Down
6 changes: 3 additions & 3 deletions tests/legacy-cli/e2e/tests/misc/support-ie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default async function () {
});

await ng('build');
await expectFileNotToExist('dist/test-project/es2015-polyfills.js');
await expectFileNotToExist('dist/test-project/polyfills.es5.js');
await expectFileToMatch('dist/test-project/index.html', oneLineTrim`
<script src="runtime.js"></script>
<script src="polyfills.js"></script>
Expand All @@ -20,10 +20,10 @@ export default async function () {
`);

await ng('build', `--es5BrowserSupport`);
await expectFileToMatch('dist/test-project/es2015-polyfills.js', 'core-js');
await expectFileToMatch('dist/test-project/polyfills.es5.js', 'core-js');
await expectFileToMatch('dist/test-project/index.html', oneLineTrim`
<script src="runtime.js"></script>
<script src="es2015-polyfills.js" nomodule></script>
<script src="polyfills.es5.js" nomodule></script>
<script src="polyfills.js"></script>
<script src="styles.js"></script>
<script src="vendor.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions tests/legacy-cli/e2e/tests/third-party/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function() {
.then(() => expectFileToMatch('dist/test-project/styles.css', '* Bootstrap'))
.then(() => expectFileToMatch('dist/test-project/index.html', oneLineTrim`
<script src="runtime.js"></script>
<script src="es2015-polyfills.js" nomodule></script>
<script src="polyfills.es5.js" nomodule></script>
<script src="polyfills.js"></script>
<script src="scripts.js"></script>
<script src="vendor.js"></script>
Expand All @@ -40,7 +40,7 @@ export default function() {
.then(() => expectFileToMatch('dist/test-project/styles.css', '* Bootstrap'))
.then(() => expectFileToMatch('dist/test-project/index.html', oneLineTrim`
<script src="runtime.js"></script>
<script src="es2015-polyfills.js" nomodule></script>
<script src="polyfills.es5.js" nomodule></script>
<script src="polyfills.js"></script>
<script src="scripts.js"></script>
<script src="main.js"></script>
Expand Down