diff options
Diffstat (limited to 'config/webpack.config.js')
-rw-r--r-- | config/webpack.config.js | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/config/webpack.config.js b/config/webpack.config.js index f02fcda827a..1218b0ef208 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -32,7 +32,6 @@ var config = { boards: './boards/boards_bundle.js', common: './commons/index.js', common_vue: './vue_shared/vue_resource_interceptor.js', - common_d3: ['d3'], cycle_analytics: './cycle_analytics/cycle_analytics_bundle.js', commit_pipelines: './commit/pipelines/pipelines_bundle.js', deploy_keys: './deploy_keys/index.js', @@ -71,7 +70,7 @@ var config = { protected_branches: './protected_branches', protected_tags: './protected_tags', registry_list: './registry/index.js', - repo: './repo/index.js', + ide: './ide/index.js', sidebar: './sidebar/sidebar_bundle.js', schedule_form: './pipeline_schedules/pipeline_schedule_form_bundle.js', schedules_index: './pipeline_schedules/pipeline_schedules_index_bundle.js', @@ -119,7 +118,10 @@ var config = { }, { test: /\_worker\.js$/, - loader: 'worker-loader', + use: [ + { loader: 'worker-loader' }, + { loader: 'babel-loader' }, + ], }, { test: /\.(worker(\.min)?\.js|pdf|bmpr)$/, @@ -177,8 +179,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('_'); }), @@ -205,7 +212,7 @@ var config = { 'pipelines', 'pipelines_details', 'registry_list', - 'repo', + 'ide', 'schedule_form', 'schedules_index', 'sidebar', @@ -225,6 +232,9 @@ var config = { 'monitoring', 'users', ], + minChunks: function (module, count) { + return module.resource && /d3-/.test(module.resource); + }, }), // create cacheable common library bundles |