Skip to content

Instantly share code, notes, and snippets.

@iwata-n
Created February 15, 2016 13:36
Show Gist options
  • Save iwata-n/be5c73592869309e07bb to your computer and use it in GitHub Desktop.
Save iwata-n/be5c73592869309e07bb to your computer and use it in GitHub Desktop.
webpack --watchでビルドが始まった時間をログに出す ref: http://qiita.com/iwata-n@github/items/6d216054fc62bebabd3d
$ webpack -w
Begin compile at Mon Feb 15 2016 22:28:19 GMT+0900 (JST)
Hash: 311c9bb85a7a95541b85
Version: webpack 1.12.13
Time: 3590ms
Asset Size Chunks Chunk Names
bundle.js 3.79 MB 0 [emitted] main
[0] multi main 28 bytes {0} [built]
+ 327 hidden modules
$ webpack
Hash: 311c9bb85a7a95541b85
Version: webpack 1.12.13
Time: 3596ms
Asset Size Chunks Chunk Names
bundle.js 3.79 MB 0 [emitted] main
[0] multi main 28 bytes {0} [built]
+ 327 hidden modules
const path = require('path')
module.exports = {
entry: [
path.join(__dirname, 'src', 'Main.jsx')
],
output: {
path: path.join(__dirname, '/public'),
filename: 'bundle.js'
},
resolve: {
// When requiring, you don't need to add these extensions
extensions: ['', '.js', '.jsx']
},
devtool: 'inline-source-map',
module: {
loaders: [
{
test: /\.(js|jsx)$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['es2015', 'react']
}
}
]
},
plugins: [
function () {
this.plugin('watch-run', (watching, callback) => {
console.log('\033[36m' + 'Begin compile at ' + new Date() + ' \033[39m')
callback()
})
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment