Adding package.json command that plays well with Travis

This commit is contained in:
Zac Ioannidis
2020-12-14 14:20:13 +00:00
parent 2108a79808
commit 6a553795c4
2 changed files with 7 additions and 1 deletions

View File

@@ -7,7 +7,11 @@ const paths = require("./paths");
// Make sure that including paths.js after env.js will read .env variables.
delete require.cache[require.resolve("./paths")];
/** env variables from config.js */
// START - injecting env variables from config.js
// This section is responsible for require-ing the provided
// command-line argument configuration file and serializing it.
// It will later be available inside our app under process.env,
// through webpack.definePlugin
const CONFIG = process.env.CONFIG || "config.js";
const envConfig = require("../" + CONFIG);
@@ -15,6 +19,7 @@ const userConfig = {};
for (const k in envConfig) {
userConfig[k] = JSON.stringify(envConfig[k]);
}
// END - injecting env variables from config.js
const NODE_ENV = process.env.NODE_ENV;
if (!NODE_ENV) {

View File

@@ -11,6 +11,7 @@
"test": "node scripts/test.js --silent",
"test:ava": "NODE_ENV=production ava --verbose",
"test-watch": "ava --watch",
"lint": "echo 'This is a placeholder for Travis'",
"lint:fix": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}\""
},
"dependencies": {