mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
feat: use runInNewContext: true for nuxt dev (#4508)
This commit is contained in:
parent
58569cef18
commit
1162f2ddc1
@ -3,7 +3,8 @@
|
||||
export default () => ({
|
||||
bundleRenderer: {
|
||||
shouldPrefetch: () => false,
|
||||
shouldPreload: (fileWithoutQuery, asType) => ['script', 'style'].includes(asType)
|
||||
shouldPreload: (fileWithoutQuery, asType) => ['script', 'style'].includes(asType),
|
||||
runInNewContext: undefined
|
||||
},
|
||||
resourceHints: true,
|
||||
ssr: undefined,
|
||||
|
@ -341,5 +341,11 @@ export function getNuxtConfig(_options) {
|
||||
consola.level = 0
|
||||
}
|
||||
|
||||
// Use runInNewContext for dev mode by default
|
||||
const { bundleRenderer } = options.render
|
||||
if (typeof bundleRenderer.runInNewContext === 'undefined') {
|
||||
bundleRenderer.runInNewContext = options.dev
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
|
@ -244,7 +244,6 @@ export default class VueRenderer {
|
||||
const hasModules = fs.existsSync(path.resolve(this.context.options.rootDir, 'node_modules'))
|
||||
|
||||
const rendererOptions = {
|
||||
runInNewContext: false,
|
||||
clientManifest: this.context.resources.clientManifest,
|
||||
// for globally installed nuxt command, search dependencies in global dir
|
||||
basedir: hasModules ? this.context.options.rootDir : __dirname,
|
||||
|
Loading…
Reference in New Issue
Block a user