Files
gnatdashboard/webui/config/helpers.js
Charly Delay 92991a92d2 webui: upgrade Angular 2.4.3
Also upgrade other dependencies such as the latest and greatest Webpack.
Refactor sources to comply to the coding style in order to have a clean
run for tests.

Change-Id: Ic10271c92c4b8c4b7991acfb28670d80b03a1f2b
2017-01-20 09:03:27 -05:00

32 lines
738 B
JavaScript

/**
* @author: @AngularClass
*/
var path = require('path');
const EVENT = process.env.npm_lifecycle_event || '';
// Helper functions
var ROOT = path.resolve(__dirname, '..');
function hasProcessFlag(flag) {
return process.argv.join('').indexOf(flag) > -1;
}
function hasNpmFlag(flag) {
return EVENT.includes(flag);
}
function isWebpackDevServer() {
return process.argv[1] && !! (/webpack-dev-server/.exec(process.argv[1]));
}
var root = path.join.bind(path, ROOT);
var build = path.join.bind(
path, process.env.BUILD_DIR ? process.env.BUILD_DIR : ROOT);
exports.hasProcessFlag = hasProcessFlag;
exports.hasNpmFlag = hasNpmFlag;
exports.isWebpackDevServer = isWebpackDevServer;
exports.root = root;
exports.build = build;