diff options
Diffstat (limited to 'client/config/helpers.js')
-rw-r--r-- | client/config/helpers.js | 9 |
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 @@ | |||
1 | const path = require('path') | 1 | const path = require('path') |
2 | 2 | ||
3 | // Helper functions | ||
3 | const ROOT = path.resolve(__dirname, '..') | 4 | const ROOT = path.resolve(__dirname, '..') |
4 | 5 | const EVENT = process.env.npm_lifecycle_event || '' | |
5 | console.log('root directory:', root() + '\n') | ||
6 | 6 | ||
7 | function hasProcessFlag (flag) { | 7 | function hasProcessFlag (flag) { |
8 | return process.argv.join('').indexOf(flag) > -1 | 8 | return process.argv.join('').indexOf(flag) > -1 |
9 | } | 9 | } |
10 | 10 | ||
11 | function hasNpmFlag (flag) { | ||
12 | return EVENT.includes(flag) | ||
13 | } | ||
14 | |||
11 | function isWebpackDevServer () { | 15 | function 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 | ||
20 | exports.hasProcessFlag = hasProcessFlag | 24 | exports.hasProcessFlag = hasProcessFlag |
25 | exports.hasNpmFlag = hasNpmFlag | ||
21 | exports.isWebpackDevServer = isWebpackDevServer | 26 | exports.isWebpackDevServer = isWebpackDevServer |
22 | exports.root = root | 27 | exports.root = root |