try to fix npm build

This commit is contained in:
Jan Prochazka
2022-03-24 09:49:14 +01:00
parent ba77b32e9a
commit 45277e34c9
2 changed files with 14 additions and 2 deletions

View File

@@ -9,10 +9,17 @@ function getNamedArg(name) {
const checkParent = process.argv.includes('--checkParent');
const startProcess = getNamedArg('--start-process');
const isForkedApi = process.argv.includes('--is-forked-api');
const pluginsDir = getNamedArg('--plugins-dir');
function getPassArgs() {
if (global['NATIVE_MODULES']) return ['--native-modules', global['NATIVE_MODULES']];
return [];
const res = [];
if (global['NATIVE_MODULES']) {
res.push('--native-modules', global['NATIVE_MODULES']);
}
if (global['PLUGINS_DIR']) {
res.push('--plugins-dir', global['PLUGINS_DIR']);
}
return res;
}
module.exports = {
@@ -20,4 +27,5 @@ module.exports = {
startProcess,
isForkedApi,
getPassArgs,
pluginsDir,
};