diff --git a/generators/assets/webpack/templates/webpack.config.js.tmpl b/generators/assets/webpack/templates/webpack.config.js.tmpl index 2f613e260..9ab8ed91b 100644 --- a/generators/assets/webpack/templates/webpack.config.js.tmpl +++ b/generators/assets/webpack/templates/webpack.config.js.tmpl @@ -16,22 +16,22 @@ const configurator = { './assets/css/application.scss', ], } - + Glob.sync("./assets/*/*.*").forEach((entry) => { if (entry === './assets/css/application.scss') { return } - + let key = entry.replace(/(\.\/assets\/(js|css|go)\/)|\.(js|s[ac]ss|go)/g, '') if(key.startsWith("_") || (/(js|s[ac]ss|go)$/i).test(entry) == false) { return } - + if( entries[key] == null) { entries[key] = [entry] return - } - + } + entries[key].push(entry) }) @@ -73,7 +73,7 @@ const configurator = { buildConfig: function(){ const env = process.env.NODE_ENV || "development"; - + var config = { mode: env, entry: configurator.entries(), @@ -104,4 +104,4 @@ const configurator = { } } -module.exports = configurator.buildConfig() \ No newline at end of file +module.exports = configurator.buildConfig()