mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 00:52:01 +00:00
perf(webpack): use fs cache by default
This commit is contained in:
parent
5ed6fa7612
commit
5d5183ee82
@ -164,18 +164,22 @@ export function baseTranspile (ctx: WebpackConfigContext) {
|
|||||||
function getCache (ctx: WebpackConfigContext): Configuration['cache'] {
|
function getCache (ctx: WebpackConfigContext): Configuration['cache'] {
|
||||||
const { options } = ctx
|
const { options } = ctx
|
||||||
|
|
||||||
if (!options.build.cache) {
|
if (!options.dev) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
name: ctx.name,
|
||||||
type: 'filesystem',
|
type: 'filesystem',
|
||||||
cacheDirectory: resolve('node_modules/.cache/@nuxt/webpack/'),
|
cacheDirectory: resolve(ctx.options.rootDir, 'node_modules/.cache/webpack'),
|
||||||
|
managedPaths: [
|
||||||
|
...ctx.options.modulesDir
|
||||||
|
],
|
||||||
buildDependencies: {
|
buildDependencies: {
|
||||||
config: [...options._nuxtConfigFiles]
|
config: [
|
||||||
},
|
...ctx.options._nuxtConfigFiles
|
||||||
...(options.build.cache as any),
|
]
|
||||||
name
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { defineNuxtConfig } from '@nuxt/kit'
|
import { defineNuxtConfig } from '@nuxt/kit'
|
||||||
|
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
vite: true
|
vite: false
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user