mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
Add progress-bar when building
This commit is contained in:
parent
ae8700f117
commit
c5b8d16a2b
@ -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)
|
||||
|
@ -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(
|
||||
|
@ -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",
|
||||
|
@ -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()
|
||||
]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user