Add progress-bar when building

This commit is contained in:
Sébastien Chopin 2017-02-08 14:09:59 +01:00
parent ae8700f117
commit c5b8d16a2b
4 changed files with 14 additions and 6 deletions

View File

@ -24,12 +24,11 @@ if (typeof options.rootDir !== 'string') {
options.dev = true // Add hot reloading and watching changes
var nuxt = new Nuxt(options)
var server = new nuxt.Server(nuxt)
.listen(process.env.PORT || process.env.npm_package_config_nuxt_port, process.env.HOST || process.env.npm_package_config_nuxt_host)
listenOnConfigChanges(nuxt, server)
nuxt.build()
.then(() => {
var server = new nuxt.Server(nuxt)
.listen(process.env.PORT || process.env.npm_package_config_nuxt_port, process.env.HOST || process.env.npm_package_config_nuxt_host)
listenOnConfigChanges(nuxt, server)
})
.catch((err) => {
console.error(err) // eslint-disable-line no-console
process.exit(1)

View File

@ -3,6 +3,7 @@
import { each } from 'lodash'
import webpack from 'webpack'
import ExtractTextPlugin from 'extract-text-webpack-plugin'
import ProgressBarPlugin from 'progress-bar-webpack-plugin'
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
import base from './base.config.js'
import { resolve } from 'path'
@ -52,6 +53,11 @@ export default function () {
})
])
// client bundle progress bar
config.plugins.push(
new ProgressBarPlugin()
)
// Production client build
if (!this.dev) {
config.plugins.push(

View File

@ -69,6 +69,7 @@
"memory-fs": "^0.4.1",
"path-to-regexp": "^1.7.0",
"pify": "^2.3.0",
"progress-bar-webpack-plugin": "^1.9.3",
"serialize-javascript": "^1.3.0",
"serve-static": "^1.11.1",
"url-loader": "^0.5.7",

View File

@ -1,4 +1,5 @@
var nodeExternals = require('webpack-node-externals')
var ProgressBarPlugin = require('progress-bar-webpack-plugin')
var CopyWebpackPlugin = require('copy-webpack-plugin')
var resolve = require('path').resolve
var r = function (p) { return resolve(__dirname, p) }
@ -48,6 +49,7 @@ module.exports = {
new CopyWebpackPlugin([
{ from: 'lib/app', to: 'app' },
{ from: 'lib/views', to: 'views' }
])
]),
new ProgressBarPlugin()
]
}