Merge pull request #4968 from scinote-eln/ma_SCI_7916

Fix webpack if no addons are present [SCI-7916]
This commit is contained in:
artoscinote 2023-02-14 10:59:31 +01:00 committed by GitHub
commit 03631d28aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,7 +11,16 @@ environment.loaders.prepend('vue', vue)
// Engine pack loading based on https://github.com/rails/webpacker/issues/348#issuecomment-635480949
// Get paths to all engines' folders
const enginePaths = execSync('ls -d $PWD/addons/*').toString().split('\n').filter((p) => !!p);
console.log('Including packs from addons...');
let enginePaths = [];
try {
enginePaths = execSync('ls -d $PWD/addons/*').toString().split('\n').filter((p) => !!p);
} catch {
console.log('Unable to find any addons.')
}
enginePaths.forEach((path) => {
const packsFolderPath = `${path}/app/javascript/packs`;