Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
refactor: move runtimeCompiler option into vue namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
jhuang@hsk-partners.com committed May 12, 2022
1 parent 2d90a5b commit ea68141
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
10 changes: 5 additions & 5 deletions packages/nuxt/src/core/nitro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ export async function initNitro (nuxt: Nuxt) {
// Vue 3 mocks
'estree-walker': 'unenv/runtime/mock/proxy',
'@babel/parser': 'unenv/runtime/mock/proxy',
'@vue/compiler-core': (nuxt.options.runtimeCompiler && !nuxt.options.dev) ? '@vue/compiler-core' : 'unenv/runtime/mock/proxy',
'@vue/compiler-dom': (nuxt.options.runtimeCompiler && !nuxt.options.dev) ? '@vue/compiler-dom' : 'unenv/runtime/mock/proxy',
'@vue/compiler-ssr': (nuxt.options.runtimeCompiler && !nuxt.options.dev) ? '@vue/compiler-ssr' : 'unenv/runtime/mock/proxy',
'@vue/compiler-core': (nuxt.options.vue.runtimeCompiler && !nuxt.options.dev) ? '@vue/compiler-core' : 'unenv/runtime/mock/proxy',
'@vue/compiler-dom': (nuxt.options.vue.runtimeCompiler && !nuxt.options.dev) ? '@vue/compiler-dom' : 'unenv/runtime/mock/proxy',
'@vue/compiler-ssr': (nuxt.options.vue.runtimeCompiler && !nuxt.options.dev) ? '@vue/compiler-ssr' : 'unenv/runtime/mock/proxy',
'@vue/devtools-api': 'unenv/runtime/mock/proxy',

// Renderer
Expand All @@ -93,7 +93,7 @@ export async function initNitro (nuxt: Nuxt) {
plugins: []
},
commonJS: {
dynamicRequireTargets: (nuxt.options.runtimeCompiler && !nuxt.options.dev)
dynamicRequireTargets: (nuxt.options.vue.runtimeCompiler && !nuxt.options.dev)
? [
'./node_modules/@vue/compiler-core',
'./node_modules/@vue/compiler-dom',
Expand Down Expand Up @@ -132,7 +132,7 @@ export async function initNitro (nuxt: Nuxt) {
})

// Enable runtime compiler client side
if (nuxt.options.runtimeCompiler) {
if (nuxt.options.vue.runtimeCompiler) {
// set vue esm on client
nuxt.hook('vite:extendConfig', (config, { isClient }) => {
if (isClient) {
Expand Down
12 changes: 5 additions & 7 deletions packages/schema/src/config/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,11 @@ export default {
embed: 'src'
},
compilerOptions: { $resolve: (val, get) => val ?? get('vue.compilerOptions') },
/**
* enable runtime compiler
* @version 3
*/
runtimeCompiler: false
},
css: {
importLoaders: 0,
Expand Down Expand Up @@ -639,11 +644,4 @@ export default {
*/
followSymlinks: false
},


/**
* enable runtime compiler on build
* @version 3
*/
runtimeCompiler: false
}

0 comments on commit ea68141

Please sign in to comment.