Use rootModule when module is concatenated

Signed-off-by: Louis Chemineau <louis@chmn.me>
This commit is contained in:
Louis Chemineau 2021-12-01 22:29:37 +01:00 committed by John Molakvoæ
parent 5a51a6b3e5
commit 8ee7c20e4d
No known key found for this signature in database
GPG key ID: 60C25B8C072916CF

View file

@ -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