Upgrade scripts and embed webpack config

This commit is contained in:
Chocobozzz 2017-12-12 11:38:02 +01:00
parent 63c4db6d71
commit 7bfd1b1edb
No known key found for this signature in database
GPG key ID: 583A612D890159BE
15 changed files with 81 additions and 1986 deletions

27
client/webpack/helpers.js Normal file
View file

@ -0,0 +1,27 @@
const path = require('path')
// Helper functions
const ROOT = path.resolve(__dirname, '..')
const EVENT = process.env.npm_lifecycle_event || ''
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]))
}
function root (args) {
args = Array.prototype.slice.call(arguments, 0)
return path.join.apply(path, [ROOT].concat(args))
}
exports.hasProcessFlag = hasProcessFlag
exports.hasNpmFlag = hasNpmFlag
exports.isWebpackDevServer = isWebpackDevServer
exports.root = root