diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-02-11 23:52:42 +0100 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2022-02-12 00:10:28 +0100 |
commit | f3b9a2b590147c8b383b9db7e46684e89d74ad69 (patch) | |
tree | c3be96eb7abc362ba0d633ee9104e157332b1feb /config | |
parent | 9f763b5b79a8e6c61407943615038bafa499bd22 (diff) |
Add support for multiple source files per pack
Diffstat (limited to 'config')
-rw-r--r-- | config/webpack/shared.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/config/webpack/shared.js b/config/webpack/shared.js index de347fa88..c2a108a89 100644 --- a/config/webpack/shared.js +++ b/config/webpack/shared.js @@ -16,10 +16,16 @@ function reducePacks (data, into = {}) { const pack = data.pack[entry]; if (!pack) continue; - const packFile = typeof pack === 'string' ? pack : pack.filename; - - if (packFile) { - into[data.name ? `flavours/${data.name}/${entry}` : `core/${entry}`] = resolve(data.pack_directory, packFile); + let packFiles = []; + if (typeof pack === 'string') + packFiles = [pack]; + else if (Array.isArray(pack)) + packFiles = pack; + else + packFiles = [pack.filename]; + + if (packFiles) { + into[data.name ? `flavours/${data.name}/${entry}` : `core/${entry}`] = packFiles.map(packFile => resolve(data.pack_directory, packFile)); } } |