mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
refactor(schema): move runtimeCompiler
option out of experimental (#20606)
This commit is contained in:
parent
8353e4c66e
commit
8b86d39e30
@ -130,7 +130,7 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
|
||||
],
|
||||
traceInclude: [
|
||||
// force include files used in generated code from the runtime-compiler
|
||||
...(nuxt.options.experimental.runtimeVueCompiler && !nuxt.options.experimental.externalVue)
|
||||
...(nuxt.options.vue.runtimeCompiler && !nuxt.options.experimental.externalVue)
|
||||
? [
|
||||
...nuxt.options.modulesDir.reduce<string[]>((targets, path) => {
|
||||
const serverRendererPath = resolve(path, 'vue/server-renderer/index.js')
|
||||
@ -150,7 +150,7 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
|
||||
vue: await resolvePath(`vue/dist/vue.cjs${nuxt.options.dev ? '' : '.prod'}.js`)
|
||||
},
|
||||
// Vue 3 mocks
|
||||
...nuxt.options.experimental.runtimeVueCompiler || nuxt.options.experimental.externalVue
|
||||
...nuxt.options.vue.runtimeCompiler || nuxt.options.experimental.externalVue
|
||||
? {}
|
||||
: {
|
||||
'estree-walker': 'unenv/runtime/mock/proxy',
|
||||
@ -253,7 +253,7 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
|
||||
})
|
||||
|
||||
// Enable runtime compiler client side
|
||||
if (nuxt.options.experimental.runtimeVueCompiler) {
|
||||
if (nuxt.options.vue.runtimeCompiler) {
|
||||
nuxt.hook('vite:extendConfig', (config, { isClient }) => {
|
||||
if (isClient) {
|
||||
if (Array.isArray(config.resolve!.alias)) {
|
||||
|
@ -13,6 +13,13 @@ export default defineUntypedSchema({
|
||||
* @type {typeof import('@vue/compiler-core').CompilerOptions}
|
||||
*/
|
||||
compilerOptions: {},
|
||||
|
||||
/**
|
||||
* Include Vue compiler in runtime bundle.
|
||||
*/
|
||||
runtimeCompiler: {
|
||||
$resolve: async (val, get) => val ?? await get('experimental.runtimeVueCompiler') ?? false,
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -23,12 +23,6 @@ export default defineUntypedSchema({
|
||||
*/
|
||||
externalVue: true,
|
||||
|
||||
// TODO: move to `vue.runtimeCompiler` in v3.5
|
||||
/**
|
||||
* Include Vue compiler in runtime bundle.
|
||||
*/
|
||||
runtimeVueCompiler: false,
|
||||
|
||||
/**
|
||||
* Tree shakes contents of client-only components from server bundle.
|
||||
* @see https://github.com/nuxt/framework/pull/5750
|
||||
|
@ -1,8 +1,10 @@
|
||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||
export default defineNuxtConfig({
|
||||
experimental: {
|
||||
runtimeVueCompiler: true,
|
||||
externalVue: false
|
||||
},
|
||||
vue: {
|
||||
runtimeCompiler: true
|
||||
},
|
||||
builder: process.env.TEST_BUILDER as 'webpack' | 'vite' ?? 'vite'
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user