From 1dc6a9d788572310d2914e51be04dd5c22024155 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 13 Mar 2018 20:11:20 +0330 Subject: [PATCH] fix: hash route names --- lib/app/App.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/app/App.js b/lib/app/App.js index 55700944e4..a9678148f4 100644 --- a/lib/app/App.js +++ b/lib/app/App.js @@ -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 = {}<% } %>