fix(vite): inline shared folder in dev mode (#30690)

This commit is contained in:
Daniel Roe 2025-01-21 16:17:30 +00:00 committed by GitHub
parent 2dd767216c
commit a8a43a9203
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,9 +6,8 @@ import { isAbsolute, join, normalize, resolve } from 'pathe'
// import { addDevServerHandler } from '@nuxt/kit' // import { addDevServerHandler } from '@nuxt/kit'
import { isFileServingAllowed } from 'vite' import { isFileServingAllowed } from 'vite'
import type { ModuleNode, Plugin as VitePlugin } from 'vite' import type { ModuleNode, Plugin as VitePlugin } from 'vite'
import { getQuery, withTrailingSlash } from 'ufo' import { getQuery } from 'ufo'
import { normalizeViteManifest } from 'vue-bundle-renderer' import { normalizeViteManifest } from 'vue-bundle-renderer'
import escapeStringRegexp from 'escape-string-regexp'
import { distDir } from './dirs' import { distDir } from './dirs'
import type { ViteBuildContext } from './vite' import type { ViteBuildContext } from './vite'
import { isCSS } from './utils' import { isCSS } from './utils'
@ -120,10 +119,6 @@ function createViteNodeApp (ctx: ViteBuildContext, invalidates: Set<string> = ne
/^#/, /^#/,
/\?/, /\?/,
], ],
external: [
'#shared',
new RegExp('^' + escapeStringRegexp(withTrailingSlash(resolve(ctx.nuxt.options.rootDir, ctx.nuxt.options.dir.shared)))),
],
}, },
transformMode: { transformMode: {
ssr: [/.*/], ssr: [/.*/],