Commit da403f3f authored by Brian Tingle's avatar Brian Tingle

lint errors

parent 68ff879f
......@@ -10,10 +10,12 @@ export function runWebpackWithEnv(dir) {
const inSilentMode = args.s; // set to true when -s is passed on the command
if (!inSilentMode) {
// eslint-disable-next-line no-console
console.log(`Generating minified bundle for ${process.env.NODE_ENV} use for stage ${process.env.STAGE} via Webpack...`.bold.blue);
}
if (err) { // so a fatal error occurred. Stop here.
// eslint-disable-next-line no-console
console.log(err.bold.red);
return 1;
......@@ -22,21 +24,26 @@ export function runWebpackWithEnv(dir) {
const jsonStats = stats.toJson();
if (jsonStats.hasErrors) {
// eslint-disable-next-line no-console
return jsonStats.errors.map(error => console.log(error.red));
}
if (jsonStats.hasWarnings && !inSilentMode) {
// eslint-disable-next-line no-console
console.log('Webpack generated the following warnings: '.bold.yellow);
// eslint-disable-next-line no-console
jsonStats.warnings.map(warning => console.log(warning.yellow));
}
if (!inSilentMode) {
// eslint-disable-next-line no-console
console.log(`Webpack stats: ${stats}`);
}
// if we got this far, the build succeeded.
// eslint-disable-next-line no-console
console.log(`Your app has been compiled in production mode for env ${process.env.NODE_ENV} for stage ${process.env.STAGE} and written to ${dir}.`.green.bold);
return 0;
});
}
\ No newline at end of file
}
......@@ -13,7 +13,8 @@ import webpackConfigBuilder from '../webpack.config';
const webpackConfig = webpackConfigBuilder('development');
process.env.STAGE = "development";
console.log("STAGE:", process.env.STAGE)
// eslint-disable-next-line no-console
console.log("STAGE:", process.env.STAGE);
const bundler = webpack(webpackConfig);
......
......@@ -19,7 +19,7 @@ const getStage = function(env) {
} else {
return(JSON.stringify(process.env.STAGE));
}
}
};
const getPlugins = function (env) {
const stage = getStage();
......@@ -92,9 +92,9 @@ function outputPath() {
if(stage == PRODUCTION) {
return(`/${PRODUCTION_DIST_DIR}`);
} else if(stage == STAGING) {
return(`/${STAGING_DIST_DIR}`)
return(`/${STAGING_DIST_DIR}`);
} else if(stage == DEMO) {
return(`/${DEMO_DIST_DIR}`)
return(`/${DEMO_DIST_DIR}`);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment