aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/config/helpers.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/config/helpers.js')
-rw-r--r--client/config/helpers.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/client/config/helpers.js b/client/config/helpers.js
index 6268d2628..ca5923472 100644
--- a/client/config/helpers.js
+++ b/client/config/helpers.js
@@ -1,13 +1,17 @@
1const path = require('path') 1const path = require('path')
2 2
3// Helper functions
3const ROOT = path.resolve(__dirname, '..') 4const ROOT = path.resolve(__dirname, '..')
4 5const EVENT = process.env.npm_lifecycle_event || ''
5console.log('root directory:', root() + '\n')
6 6
7function hasProcessFlag (flag) { 7function hasProcessFlag (flag) {
8 return process.argv.join('').indexOf(flag) > -1 8 return process.argv.join('').indexOf(flag) > -1
9} 9}
10 10
11function hasNpmFlag (flag) {
12 return EVENT.includes(flag)
13}
14
11function isWebpackDevServer () { 15function isWebpackDevServer () {
12 return process.argv[1] && !!(/webpack-dev-server$/.exec(process.argv[1])) 16 return process.argv[1] && !!(/webpack-dev-server$/.exec(process.argv[1]))
13} 17}
@@ -18,5 +22,6 @@ function root (args) {
18} 22}
19 23
20exports.hasProcessFlag = hasProcessFlag 24exports.hasProcessFlag = hasProcessFlag
25exports.hasNpmFlag = hasNpmFlag
21exports.isWebpackDevServer = isWebpackDevServer 26exports.isWebpackDevServer = isWebpackDevServer
22exports.root = root 27exports.root = root