diff --git a/lib/app/App.js b/lib/app/App.js index e409ce13fa..168d7a665c 100644 --- a/lib/app/App.js +++ b/lib/app/App.js @@ -6,7 +6,7 @@ import '<%= relativeToBuild(resolvePath(c.src || c)) %>' <%= Object.keys(layouts).map(key => { if (splitChunks.layouts) { - return `const _${hash(key)} = () => import('${layouts[key]}' /* webpackChunkName: "${wChunk('layouts/' + key)}" */).then(m => m.default || m)` + return `const _${hash(key)} = () => import('${layouts[key]}' /* webpackPrefetch: true, webpackChunkName: "${wChunk('layouts/' + key)}" */).then(m => m.default || m)` } else { return `import _${hash(key)} from '${layouts[key]}'` } diff --git a/lib/app/router.js b/lib/app/router.js index c07a1bc957..f80777a55f 100644 --- a/lib/app/router.js +++ b/lib/app/router.js @@ -26,7 +26,7 @@ const _routes = recursiveRoutes(router.routes, '\t\t', _components) const name = route._name if (splitChunks.pages) { - return `const ${name} = () => import('${path}' /* webpackChunkName: "${chunkName}" */).then(m => m.default || m)` + return `const ${name} = () => import('${path}' /* webpackPrefetch: true, webpackChunkName: "${chunkName}" */).then(m => m.default || m)` } else { return `import ${name} from '${path}'` }