Skip to content

fix(@angular-devkit/build-angular): avoid defer attribute for Safari nomodule polyfill #15276

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
Aug 12, 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 @@ -150,7 +150,10 @@ export async function augmentIndexHtml(params: AugmentIndexHtmlOptions): Promise
const isModuleType = moduleFiles.some(scriptPredictor);

if (isNoModuleType && !isModuleType) {
attrs.push({ name: 'nomodule', value: null }, { name: 'defer', value: null });
attrs.push({ name: 'nomodule', value: null });
if (!script.startsWith('polyfills-nomodule-es5')) {
attrs.push({ name: 'defer', value: null });
}
} else if (isModuleType && !isNoModuleType) {
attrs.push({ name: 'type', value: 'module' });
} else {
Expand Down
2 changes: 1 addition & 1 deletion tests/legacy-cli/e2e/tests/misc/support-safari-10.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default async function () {
await ng('build');
await expectFileToExist('dist/test-project/polyfills-nomodule-es5.js');
await expectFileToMatch('dist/test-project/index.html', oneLineTrim`
<script src="polyfills-nomodule-es5.js" nomodule defer></script>
<script src="polyfills-nomodule-es5.js" nomodule></script>
<script src="runtime-es2015.js" type="module"></script>
<script src="polyfills-es2015.js" type="module"></script>
<script src="runtime-es5.js" nomodule defer></script>
Expand Down