mirror of
https://github.com/openstf/stf
synced 2025-10-03 17:59:28 +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 webpack = require('webpack')
|
||||||
var CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin')
|
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 = {
|
module.exports = {
|
||||||
webpack: {
|
webpack: {
|
||||||
|
@ -76,13 +81,23 @@ module.exports = {
|
||||||
, ['main']
|
, ['main']
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
, new webpack.ResolverPlugin(
|
, new webpack.ResolverPlugin(
|
||||||
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin(
|
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin(
|
||||||
'.bower.json'
|
'.bower.json'
|
||||||
, ['main']
|
, ['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: {
|
webpackServer: {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue