fix: hash route names

This commit is contained in:
Pooya Parsa 2018-03-13 20:11:20 +03:30
parent 86d0031ae6
commit 1dc6a9d788

View File

@ -6,13 +6,13 @@ import '<%= relativeToBuild(resolvePath(c.src || c)) %>'
<%= Object.keys(layouts).map(key => {
if (splitPages) {
return `const _${key} = () => import('${layouts[key]}' /* webpackChunkName: "${wChunk('layouts/' + key)}" */).then(m => m.default || m)`
return `const _${hash(key)} = () => import('${layouts[key]}' /* webpackChunkName: "${wChunk('layouts/' + key)}" */).then(m => m.default || m)`
} else {
return `import _${key} from '${layouts[key]}'`
return `import _${hash(key)} from '${layouts[key]}'`
}
}).join('\n') %>
const layouts = { <%= Object.keys(layouts).map(key => '_' + key).join(',') %> }
const layouts = { <%= Object.keys(layouts).map(key => `"_${key}": _${hash(key)}`).join(',') %> }
<% if (splitPages) { %>let resolvedLayouts = {}<% } %>