From 58b8b80787c47185bbca59bbb2039c2ba9022d27 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Wed, 20 Dec 2017 17:16:37 -0600 Subject: properly handle naming for dispatcher route chunks --- config/webpack.config.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/webpack.config.js b/config/webpack.config.js index 78ced4c3e8c..0cb69141a73 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -176,8 +176,13 @@ var config = { return chunk.name; } return chunk.mapModules((m) => { - var chunkPath = m.request.split('!').pop(); - return path.relative(m.context, chunkPath); + const pagesBase = path.join(ROOT_PATH, 'app/assets/javascripts/pages'); + if (m.resource.indexOf(pagesBase) === 0) { + return path.relative(pagesBase, m.resource) + .replace(/\/index\.[a-z]+$/, '') + .replace(/\//g, '__'); + } + return path.relative(m.context, m.resource); }).join('_'); }), -- cgit v1.2.3