webpack.NamedChunksPlugin fails in combination with webpack.optimize.ModuleConcatenationPlugin
When working on https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16189, I experience the following error:
10:30:42 webpack.1 | .../gitlab-ce/config/webpack.config.js:183
10:30:42 webpack.1 | if (m.resource.indexOf(pagesBase) === 0) {
10:30:42 webpack.1 | ^
10:30:42 webpack.1 |
10:30:42 webpack.1 | TypeError: Cannot read property 'indexOf' of undefined
10:30:42 webpack.1 | at chunk.mapModules (.../gitlab-ce/config/webpack.config.js:183:24)
10:30:42 webpack.1 | at Function.from (native)
10:30:42 webpack.1 | at Chunk.mapModules (.../gitlab-ce/node_modules/webpack/lib/Chunk.js:163:16)
10:30:42 webpack.1 | at NamedChunksPlugin.config.plugins.webpack.NamedChunksPlugin [as nameResolver] (.../gitlab-ce/config/webpack.config.js:181:20)
10:30:42 webpack.1 | at chunks.forEach (.../gitlab-ce/node_modules/webpack/lib/NamedChunksPlugin.js:22:23)
10:30:42 webpack.1 | at Array.forEach (<anonymous>)
10:30:42 webpack.1 | at Compilation.compilation.plugin (.../gitlab-ce/node_modules/webpack/lib/NamedChunksPlugin.js:20:12)
10:30:42 webpack.1 | at Compilation.applyPlugins1 (.../gitlab-ce/node_modules/tapable/lib/Tapable.js:75:14)
10:30:42 webpack.1 | at sealPart2 (.../gitlab-ce/node_modules/webpack/lib/Compilation.js:623:9)
10:30:42 webpack.1 | at Compilation.applyPluginsAsyncSeries (.../gitlab-ce/node_modules/tapable/lib/Tapable.js:195:46)
10:30:42 webpack.1 | at Compilation.seal (.../gitlab-ce/node_modules/webpack/lib/Compilation.js:596:8)
10:30:42 webpack.1 | at applyPluginsParallel.err (.../gitlab-ce/node_modules/webpack/lib/Compiler.js:514:17)
10:30:42 webpack.1 | at .../gitlab-ce/node_modules/tapable/lib/Tapable.js:289:11
10:30:42 webpack.1 | at _addModuleChain (.../gitlab-ce/node_modules/webpack/lib/Compilation.js:498:11)
10:30:42 webpack.1 | at processModuleDependencies.err (.../gitlab-ce/node_modules/webpack/lib/Compilation.js:468:14)
10:30:42 webpack.1 | at _combinedTickCallback (internal/process/next_tick.js:131:7)
This happens here because ConcatenatedModule used by the ModuleConcatenationPlugin does not have context nor resource set.