diff --git a/webpack.common.js b/webpack.common.js index 74fbef1aa9eef..dbe36cd2cd0a0 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -27,7 +27,10 @@ module.exports = { publicPath: '/dist/', filename: (chunkData) => { // Get relative path of the src folder - const srcPath = chunkData.chunk.entryModule.context + let srcPath = chunkData.chunk.entryModule.context + if (srcPath === null) { + srcPath = chunkData.chunk.entryModule.rootModule.context + } const relativePath = path.relative(__dirname, srcPath) // If this is a core source, output in core dist folder @@ -35,7 +38,7 @@ module.exports = { return path.join('core/js/dist/', '[name].js?v=[contenthash]') } // Get out of the shared dist folder and output inside apps js folder - return path.join(relativePath, '..', 'js') + '/[name].js?v=[contenthash]' + return path.join(relativePath, '..', 'js') + '/dist/[name].js?v=[contenthash]' }, chunkFilename: 'dist/[name]-[id].js?v=[contenthash]', },