Backport webpack.config.js changes from EE
This commit is contained in:
parent
71ba398263
commit
5bb6124ce7
|
@ -27,11 +27,11 @@ var pageEntries = glob.sync('pages/**/index.js', { cwd: path.join(ROOT_PATH, 'ap
|
|||
|
||||
// filter out entries currently imported dynamically in dispatcher.js
|
||||
var dispatcher = fs.readFileSync(path.join(ROOT_PATH, 'app/assets/javascripts/dispatcher.js')).toString();
|
||||
var dispatcherChunks = dispatcher.match(/(?!import\('.\/)pages\/[^']+/g);
|
||||
var dispatcherChunks = dispatcher.match(/(?!import\(')\.\/pages\/[^']+/g);
|
||||
|
||||
pageEntries.forEach(( path ) => {
|
||||
let chunkPath = path.replace(/\/index\.js$/, '');
|
||||
if (!dispatcherChunks.includes(chunkPath)) {
|
||||
if (!dispatcherChunks.includes('./' + chunkPath)) {
|
||||
let chunkName = chunkPath.replace(/\//g, '.');
|
||||
autoEntries[chunkName] = './' + path;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue