mirror of
https://github.com/openstf/stf
synced 2025-10-03 09:49:17 +02:00
Show webpack build progress.
This commit is contained in:
parent
1fed3b9da5
commit
ce948c3a92
1 changed files with 18 additions and 3 deletions
|
@ -1,6 +1,11 @@
|
|||
var pathutil = require('./lib/util/pathutil')
|
||||
var _ = require('lodash')
|
||||
|
||||
var webpack = require('webpack')
|
||||
var CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin')
|
||||
var ProgressPlugin = require('webpack/lib/ProgressPlugin')
|
||||
|
||||
var pathutil = require('./lib/util/pathutil')
|
||||
var log = require('./lib/util/logger').createLogger('webpack:config')
|
||||
|
||||
module.exports = {
|
||||
webpack: {
|
||||
|
@ -76,13 +81,23 @@ module.exports = {
|
|||
, ['main']
|
||||
)
|
||||
)
|
||||
, new webpack.ResolverPlugin(
|
||||
, new webpack.ResolverPlugin(
|
||||
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin(
|
||||
'.bower.json'
|
||||
, ['main']
|
||||
)
|
||||
)
|
||||
, new CommonsChunkPlugin('entry/commons.entry.js')
|
||||
, new CommonsChunkPlugin('entry/commons.entry.js')
|
||||
, new ProgressPlugin(_.throttle(
|
||||
function(progress, message) {
|
||||
log.info(
|
||||
'Build progress %d%% (%s)'
|
||||
, Math.floor(progress * 100)
|
||||
, message ? message : (progress >= 1 ? 'complete' : 'unknown')
|
||||
)
|
||||
}
|
||||
, 1000
|
||||
))
|
||||
]
|
||||
},
|
||||
webpackServer: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue