Skip to content

Commit cbb9bd9

Browse files
authored
fix init snippet (#2917)
### Fixes # <!-- Mention the issues this PR addresses --> ### Checks - [ ] Ran `yarn test-build` - [ ] Updated relevant documentations - [ ] Updated matching config options in altair-static ### Changes proposed in this pull request: <!-- Describe the changes being introduced in this PR --> ## Summary by Sourcery Bug Fixes: - Add type="module" attribute to the injected script tag in renderAltair to ensure correct module loading <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Updated the script loading mechanism for initial configuration to utilize module script behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent d0fef43 commit cbb9bd9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/altair-static/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export const renderAltair = (options: RenderOptions = {}) => {
108108
.replace(
109109
'</body>',
110110
() =>
111-
`<script nonce="${options.cspNonce ?? ''}" src="${scriptName.replace(/["'<>=]/g, '')}"></script></body>`
111+
`<script type="module" nonce="${options.cspNonce ?? ''}" src="${scriptName.replace(/["'<>=]/g, '')}"></script></body>`
112112
);
113113
}
114114
}

0 commit comments

Comments
 (0)