properly handle naming for dispatcher route chunks

This commit is contained in:
Mike Greiling 2017-12-20 17:16:37 -06:00
parent 130b03c264
commit 58b8b80787
No known key found for this signature in database
GPG key ID: 0303DF507FA67596

View file

@ -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('_');
}),