feature: handle multiple configs
This commit is contained in:
@ -2,7 +2,7 @@ const HTMLAsset = require('parcel-bundler/lib/assets/HTMLAsset')
|
||||
|
||||
function shouldIgnore (file) {
|
||||
// Ignore img(src="${...}") on pug & keep the components folder pristine
|
||||
return /\${.+}/.test(file) || /components/.test(file);
|
||||
return /\${.+}/.test(file) || /components/.test(file) || /\/lib\/solid-/.test(file);
|
||||
}
|
||||
|
||||
class SkipStartinbloxWidgetAsset extends HTMLAsset {
|
||||
|
@ -26,12 +26,14 @@ const options = {
|
||||
};
|
||||
|
||||
(async function() {
|
||||
if(!fs.existsSync("config.json")) throw "[Error] (Mandatory) Missing config.json file";
|
||||
let configPath = process.env.CONFIG_PATH || 'config.json';
|
||||
if(!fs.existsSync(configPath)) throw `[Error] (Mandatory) Missing ${configPath} file`;
|
||||
console.log(`Using ${configPath} config file`);
|
||||
|
||||
let config = JSON.parse(fs.readFileSync('config.json'));
|
||||
let config = JSON.parse(fs.readFileSync(configPath));
|
||||
|
||||
if(!config.clientName) throw "[Error] (Mandatory) Missing clientName on config.json";
|
||||
if(!config.clientLogo) throw "[Error] (Mandatory) Missing clientLogo on config.json";
|
||||
if(!config.clientName) throw `[Error] (Mandatory) Missing clientName on ${configPath}`;
|
||||
if(!config.clientLogo) throw `[Error] (Mandatory) Missing clientLogo on ${configPath}`;
|
||||
|
||||
let manifest = {
|
||||
"lang": "fr",
|
||||
|
Reference in New Issue
Block a user