diff --git a/packages/nuxt/src/core/plugins/dev-only.ts b/packages/nuxt/src/core/plugins/dev-only.ts index 0cd7a40f2b..9899e663ff 100644 --- a/packages/nuxt/src/core/plugins/dev-only.ts +++ b/packages/nuxt/src/core/plugins/dev-only.ts @@ -9,7 +9,7 @@ interface DevOnlyPluginOptions { sourcemap?: boolean } -export const DevOnlyPlugin = createUnplugin((options: DevOnlyPluginOptions) => { +export const DevOnlyPlugin = createUnplugin((options: DevOnlyPluginOptions, meta) => { const DEVONLY_COMP_RE = /<(?:dev-only|DevOnly)>[\s\S]*?<\/(?:dev-only|DevOnly)>/g return { @@ -20,7 +20,7 @@ export const DevOnlyPlugin = createUnplugin((options: DevOnlyPluginOptions) => { const { type } = parseQuery(search) // vue files - if (pathname.endsWith('.vue') && (type === 'template' || !search)) { + if (pathname.endsWith('.vue') && (meta.framework === 'webpack' || type === 'template' || !search)) { return true } },