mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-01 18:07:22 +00:00
feat: better error handler
This commit is contained in:
parent
2c83f6ea6a
commit
7e682ed663
@ -8,7 +8,9 @@ import wpfs from '../utils/wpfs'
|
|||||||
export default function (nuxt, moduleContainer) {
|
export default function (nuxt, moduleContainer) {
|
||||||
// Build in node_modules/.cache/nuxt
|
// Build in node_modules/.cache/nuxt
|
||||||
const oldBuildDir = nuxt.options.buildDir
|
const oldBuildDir = nuxt.options.buildDir
|
||||||
nuxt.options.buildDir = resolve(nuxt.options.rootDir, 'node_modules/.cache/nuxt')
|
if (!nuxt.options.dev) {
|
||||||
|
nuxt.options.buildDir = resolve(nuxt.options.rootDir, 'node_modules/.cache/nuxt')
|
||||||
|
}
|
||||||
nuxt.options.build.transpile = nuxt.options.build.transpile || []
|
nuxt.options.build.transpile = nuxt.options.build.transpile || []
|
||||||
nuxt.options.build.transpile.push(nuxt.options.buildDir)
|
nuxt.options.build.transpile.push(nuxt.options.buildDir)
|
||||||
nuxt.options.appTemplatePath = nuxt.options.appTemplatePath
|
nuxt.options.appTemplatePath = nuxt.options.appTemplatePath
|
||||||
|
@ -119,7 +119,8 @@ export const getRollupConfig = (sigmaContext: SigmaContext) => {
|
|||||||
'process.env.NUXT_STATIC_VERSION': JSON.stringify(sigmaContext._nuxt.staticAssets.version),
|
'process.env.NUXT_STATIC_VERSION': JSON.stringify(sigmaContext._nuxt.staticAssets.version),
|
||||||
'process.env.NUXT_FULL_STATIC': sigmaContext._nuxt.fullStatic as unknown as string,
|
'process.env.NUXT_FULL_STATIC': sigmaContext._nuxt.fullStatic as unknown as string,
|
||||||
'process.env.SIGMA_PRESET': JSON.stringify(sigmaContext.preset),
|
'process.env.SIGMA_PRESET': JSON.stringify(sigmaContext.preset),
|
||||||
'process.env.RUNTIME_CONFIG': JSON.stringify(sigmaContext._nuxt.runtimeConfig)
|
'process.env.RUNTIME_CONFIG': JSON.stringify(sigmaContext._nuxt.runtimeConfig),
|
||||||
|
'process.env.DEBUG': JSON.stringify(sigmaContext._nuxt.dev)
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
@ -159,10 +160,12 @@ export const getRollupConfig = (sigmaContext: SigmaContext) => {
|
|||||||
|
|
||||||
// https://github.com/rollup/plugins/tree/master/packages/alias
|
// https://github.com/rollup/plugins/tree/master/packages/alias
|
||||||
const renderer = sigmaContext.renderer || 'vue2'
|
const renderer = sigmaContext.renderer || 'vue2'
|
||||||
|
const vueServerRenderer = 'vue-server-renderer/' + (sigmaContext._nuxt.dev ? 'build.dev.js' : 'build.prod.js')
|
||||||
rollupConfig.plugins.push(alias({
|
rollupConfig.plugins.push(alias({
|
||||||
entries: {
|
entries: {
|
||||||
'~runtime': sigmaContext._internal.runtimeDir,
|
'~runtime': sigmaContext._internal.runtimeDir,
|
||||||
'~renderer': require.resolve(resolve(sigmaContext._internal.runtimeDir, 'app', renderer)),
|
'~renderer': require.resolve(resolve(sigmaContext._internal.runtimeDir, 'app', renderer)),
|
||||||
|
'~vueServerRenderer': vueServerRenderer,
|
||||||
'~build': sigmaContext._nuxt.buildDir,
|
'~build': sigmaContext._nuxt.buildDir,
|
||||||
...env.alias
|
...env.alias
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user