Quality of Frontend Developer's Life: here to stay

This commit is contained in:
Henry Jameson 2018-12-11 18:45:25 +03:00
parent fb5261b926
commit b839ba7870
6 changed files with 52 additions and 9 deletions

View file

@ -7,8 +7,13 @@ var baseWebpackConfig = require('./webpack.base.conf')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var env = process.env.NODE_ENV === 'testing'
? require('../config/test.env')
: config.build.env
? require('../config/test.env')
: config.build.env
let commitHash = require('child_process')
.execSync('git rev-parse --short HEAD')
.toString();
console.log(commitHash)
var webpackConfig = merge(baseWebpackConfig, {
module: {
@ -29,7 +34,8 @@ var webpackConfig = merge(baseWebpackConfig, {
plugins: [
// http://vuejs.github.io/vue-loader/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
'process.env': env,
'COMMIT_HASH': JSON.stringify(commitHash)
}),
new webpack.optimize.UglifyJsPlugin({
compress: {