Skip to content

Commit 3c4a107

Browse files
committed
better dev output
1 parent a70341d commit 3c4a107

File tree

5 files changed

+342
-340
lines changed

5 files changed

+342
-340
lines changed

build/setup-dev-server.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ module.exports = function setupDevServer (app, cb) {
2020
const clientCompiler = webpack(clientConfig)
2121
const devMiddleware = require('webpack-dev-middleware')(clientCompiler, {
2222
publicPath: clientConfig.output.publicPath,
23-
stats: {
24-
colors: true,
25-
chunks: false
26-
}
23+
noInfo: true
2724
})
2825
app.use(devMiddleware)
2926
clientCompiler.plugin('done', () => {

build/webpack.base.config.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
const path = require('path')
22
const vueConfig = require('./vue-loader.config')
3+
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
4+
5+
const isProd = process.env.NODE_ENV === 'production'
36

47
module.exports = {
5-
devtool: '#source-map',
8+
devtool: isProd
9+
? false
10+
: '#cheap-module-eval-source-map',
611
entry: {
712
app: './src/entry-client.js',
813
vendor: [
@@ -52,6 +57,10 @@ module.exports = {
5257
]
5358
},
5459
performance: {
55-
hints: process.env.NODE_ENV === 'production' ? 'warning' : false
56-
}
60+
maxEntrypointSize: 300000,
61+
hints: isProd ? 'warning' : false
62+
},
63+
plugins: isProd ? [] : [
64+
new FriendlyErrorsPlugin()
65+
]
5766
}

build/webpack.server.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const VueSSRPlugin = require('vue-ssr-webpack-plugin')
55

66
module.exports = merge(base, {
77
target: 'node',
8+
devtool: '#source-map',
89
entry: './src/entry-server.js',
910
output: {
1011
filename: 'server-bundle.js',

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"buble-loader": "^0.4.1",
3737
"css-loader": "^0.27.3",
3838
"file-loader": "^0.10.1",
39+
"friendly-errors-webpack-plugin": "^1.6.1",
3940
"html-webpack-plugin": "^2.28.0",
4041
"rimraf": "^2.6.1",
4142
"stylus": "^0.54.5",

0 commit comments

Comments
 (0)