Commit 3c4a1075 authored by Evan You's avatar Evan You

better dev output

parent a70341d5
...@@ -20,10 +20,7 @@ module.exports = function setupDevServer (app, cb) { ...@@ -20,10 +20,7 @@ module.exports = function setupDevServer (app, cb) {
const clientCompiler = webpack(clientConfig) const clientCompiler = webpack(clientConfig)
const devMiddleware = require('webpack-dev-middleware')(clientCompiler, { const devMiddleware = require('webpack-dev-middleware')(clientCompiler, {
publicPath: clientConfig.output.publicPath, publicPath: clientConfig.output.publicPath,
stats: { noInfo: true
colors: true,
chunks: false
}
}) })
app.use(devMiddleware) app.use(devMiddleware)
clientCompiler.plugin('done', () => { clientCompiler.plugin('done', () => {
......
const path = require('path') const path = require('path')
const vueConfig = require('./vue-loader.config') const vueConfig = require('./vue-loader.config')
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
const isProd = process.env.NODE_ENV === 'production'
module.exports = { module.exports = {
devtool: '#source-map', devtool: isProd
? false
: '#cheap-module-eval-source-map',
entry: { entry: {
app: './src/entry-client.js', app: './src/entry-client.js',
vendor: [ vendor: [
...@@ -52,6 +57,10 @@ module.exports = { ...@@ -52,6 +57,10 @@ module.exports = {
] ]
}, },
performance: { performance: {
hints: process.env.NODE_ENV === 'production' ? 'warning' : false maxEntrypointSize: 300000,
} hints: isProd ? 'warning' : false
},
plugins: isProd ? [] : [
new FriendlyErrorsPlugin()
]
} }
...@@ -5,6 +5,7 @@ const VueSSRPlugin = require('vue-ssr-webpack-plugin') ...@@ -5,6 +5,7 @@ const VueSSRPlugin = require('vue-ssr-webpack-plugin')
module.exports = merge(base, { module.exports = merge(base, {
target: 'node', target: 'node',
devtool: '#source-map',
entry: './src/entry-server.js', entry: './src/entry-server.js',
output: { output: {
filename: 'server-bundle.js', filename: 'server-bundle.js',
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
"buble-loader": "^0.4.1", "buble-loader": "^0.4.1",
"css-loader": "^0.27.3", "css-loader": "^0.27.3",
"file-loader": "^0.10.1", "file-loader": "^0.10.1",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.28.0", "html-webpack-plugin": "^2.28.0",
"rimraf": "^2.6.1", "rimraf": "^2.6.1",
"stylus": "^0.54.5", "stylus": "^0.54.5",
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment