mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix(vite): remove dev styles injected via absolute path (#23126)
This commit is contained in:
parent
f79f9b3a60
commit
c045c4b154
@ -23,8 +23,8 @@ export function devStyleSSRPlugin (options: DevStyleSSRPluginOptions): Plugin {
|
||||
}
|
||||
|
||||
// When dev `<style>` is injected, remove the `<link>` styles from manifest
|
||||
const selector = joinURL(options.buildAssetsURL, moduleId)
|
||||
return code + `\ndocument.querySelectorAll(\`link[href="${selector}"]\`).forEach(i=>i.remove())`
|
||||
const selectors = [joinURL(options.buildAssetsURL, moduleId), joinURL(options.buildAssetsURL, '@fs', moduleId)]
|
||||
return code + selectors.map(selector => `\ndocument.querySelectorAll(\`link[href="${selector}"]\`).forEach(i=>i.remove())`).join('')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user