Skip to content

Commit

Permalink
fix(nuxt): skip vue style blocks in unctx transform (#26059)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Mar 3, 2024
1 parent 8e6d230 commit 4fbbc10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/nuxt/src/core/plugins/unctx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const UnctxTransformPlugin = createUnplugin((options: UnctxTransformPlugi
name: 'unctx:transform',
enforce: 'post',
transformInclude (id) {
return isVue(id) || isJS(id)
return isVue(id, { type: ['template', 'script']}) || isJS(id)
},
transform (code) {
// TODO: needed for webpack - update transform in unctx/unplugin?
Expand Down
2 changes: 2 additions & 0 deletions test/fixtures/basic/pages/styles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import '~/assets/assets.css'
</style>

<style scoped>
/* Regression test for https: //github.com/nuxt/nuxt/issues/26057 */
/* definePageMeta( */
div {
--scoped: 'scoped';
}
Expand Down

0 comments on commit 4fbbc10

Please sign in to comment.