Quality of Frontend Developer's Life: here to stay
This commit is contained in:
parent
fb5261b926
commit
b839ba7870
6 changed files with 52 additions and 9 deletions
|
@ -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: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue