diff --git a/src/node/build/render.ts b/src/node/build/render.ts index e5e226e376e6..88fef6433670 100644 --- a/src/node/build/render.ts +++ b/src/node/build/render.ts @@ -182,7 +182,10 @@ function renderHead(head: HeadConfig[]): Promise { head.map(async ([tag, attrs = {}, innerHTML = '']) => { const openTag = `<${tag}${renderAttrs(attrs)}>` if (tag !== 'link' && tag !== 'meta') { - if (tag === 'script') { + if ( + tag === 'script' && + (attrs.type === undefined || attrs.type.includes('javascript')) + ) { innerHTML = ( await transformWithEsbuild(innerHTML, 'inline-script.js', { minify: true