mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
fix(nuxt, vite): ignore nuxt_component
ssr style and isVue
(#20679)
This commit is contained in:
parent
8c75961f74
commit
1f38863c06
@ -14,6 +14,11 @@ export function isVue (id: string, opts: { type?: Array<'template' | 'script' |
|
||||
|
||||
const query = parseQuery(search)
|
||||
|
||||
// Component async/lazy wrapper
|
||||
if (query.nuxt_component) {
|
||||
return false
|
||||
}
|
||||
|
||||
// Macro
|
||||
if (query.macro && (!opts.type || opts.type.includes('script'))) {
|
||||
return true
|
||||
|
@ -93,7 +93,7 @@ export function ssrStylesPlugin (options: SSRStylePluginOptions): Plugin {
|
||||
async transform (code, id) {
|
||||
const { pathname, search } = parseURL(decodeURIComponent(pathToFileURL(id).href))
|
||||
const query = parseQuery(search)
|
||||
if (!pathname.match(/\.(vue|((c|m)?j|t)sx?)$/g) || query.macro) { return }
|
||||
if (!pathname.match(/\.(vue|((c|m)?j|t)sx?)$/g) || query.macro || query.nuxt_component) { return }
|
||||
if (options.shouldInline && !options.shouldInline(id)) { return }
|
||||
|
||||
const relativeId = relativeToSrcDir(id)
|
||||
|
Loading…
Reference in New Issue
Block a user