fix(nuxt): skip vue style blocks in unctx transform (#26059)

This commit is contained in:
Daniel Roe 2024-03-03 21:36:12 +00:00 committed by GitHub
parent 8e6d2306c0
commit 4fbbc10f62
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -17,7 +17,7 @@ export const UnctxTransformPlugin = createUnplugin((options: UnctxTransformPlugi
name: 'unctx:transform', name: 'unctx:transform',
enforce: 'post', enforce: 'post',
transformInclude (id) { transformInclude (id) {
return isVue(id) || isJS(id) return isVue(id, { type: ['template', 'script']}) || isJS(id)
}, },
transform (code) { transform (code) {
// TODO: needed for webpack - update transform in unctx/unplugin? // TODO: needed for webpack - update transform in unctx/unplugin?

View File

@ -18,6 +18,8 @@ import '~/assets/assets.css'
</style> </style>
<style scoped> <style scoped>
/* Regression test for https: //github.com/nuxt/nuxt/issues/26057 */
/* definePageMeta( */
div { div {
--scoped: 'scoped'; --scoped: 'scoped';
} }