Skip to content

Commit

Permalink
fix: do not warn (about not being able to bundle non module scripts) …
Browse files Browse the repository at this point in the history
…when src is an external url (#7380)
  • Loading branch information
rstoenescu committed Mar 19, 2022
1 parent e682863 commit 0646fe8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/vite/src/node/plugins/html.ts
Expand Up @@ -297,9 +297,11 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
someScriptsAreAsync ||= isAsync
someScriptsAreDefer ||= !isAsync
} else if (url && !isPublicFile) {
config.logger.warn(
`<script src="${url}"> in "${publicPath}" can't be bundled without type="module" attribute`
)
if (!isExcludedUrl(url)) {
config.logger.warn(
`<script src="${url}"> in "${publicPath}" can't be bundled without type="module" attribute`
)
}
} else if (node.children.length) {
const scriptNode = node.children.pop()! as TextNode
const code = scriptNode.content
Expand Down

0 comments on commit 0646fe8

Please sign in to comment.