1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Adds friendly error plugin

This commit is contained in:
Florian Didron 2016-11-16 11:46:58 +09:00
parent 7f0f3ae940
commit becf2f2a62
3 changed files with 9 additions and 19 deletions

View file

@ -53,6 +53,7 @@
"babel-runtime": "6.11.6", "babel-runtime": "6.11.6",
"cross-spawn": "4.0.2", "cross-spawn": "4.0.2",
"del": "2.2.2", "del": "2.2.2",
"friendly-errors-webpack-plugin": "1.1.0",
"glamor": "2.17.10", "glamor": "2.17.10",
"glob-promise": "1.0.6", "glob-promise": "1.0.6",
"htmlescape": "1.1.1", "htmlescape": "1.1.1",
@ -66,11 +67,11 @@
"react-dom": "15.3.2", "react-dom": "15.3.2",
"react-hot-loader": "3.0.0-beta.6", "react-hot-loader": "3.0.0-beta.6",
"send": "0.14.1", "send": "0.14.1",
"sockjs-client": "1.1.1",
"strip-ansi": "3.0.1", "strip-ansi": "3.0.1",
"url": "0.11.0", "url": "0.11.0",
"webpack": "1.13.2", "webpack": "1.13.2",
"webpack-dev-server": "1.16.2", "webpack-dev-server": "1.16.2",
"sockjs-client": "1.1.1",
"write-file-webpack-plugin": "3.3.0" "write-file-webpack-plugin": "3.3.0"
}, },
"devDependencies": { "devDependencies": {

View file

@ -7,6 +7,7 @@ import WatchPagesPlugin from './plugins/watch-pages-plugin'
import WatchRemoveEventPlugin from './plugins/watch-remove-event-plugin' import WatchRemoveEventPlugin from './plugins/watch-remove-event-plugin'
import DynamicEntryPlugin from './plugins/dynamic-entry-plugin' import DynamicEntryPlugin from './plugins/dynamic-entry-plugin'
import DetachPlugin from './plugins/detach-plugin' import DetachPlugin from './plugins/detach-plugin'
import FriendlyErrorsWebpackPlugin from 'friendly-errors-webpack-plugin'
export default async function createCompiler (dir, { hotReload = false } = {}) { export default async function createCompiler (dir, { hotReload = false } = {}) {
dir = resolve(dir) dir = resolve(dir)
@ -49,7 +50,10 @@ export default async function createCompiler (dir, { hotReload = false } = {}) {
new DynamicEntryPlugin(), new DynamicEntryPlugin(),
new UnlinkFilePlugin(), new UnlinkFilePlugin(),
new WatchRemoveEventPlugin(), new WatchRemoveEventPlugin(),
new WatchPagesPlugin(dir) new WatchPagesPlugin(dir),
new FriendlyErrorsWebpackPlugin({
messages: ['Your application is running here http://localhost:3000']
})
] : [ ] : [
new webpack.optimize.UglifyJsPlugin({ new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false }, compress: { warnings: false },

View file

@ -82,23 +82,8 @@ export default class HotReloader {
publicPath: '/', publicPath: '/',
hot: true, hot: true,
noInfo: true, noInfo: true,
clientLogLevel: 'warning', quiet: true,
stats: { clientLogLevel: 'warning'
assets: false,
children: false,
chunks: false,
color: false,
errors: true,
errorDetails: false,
hash: false,
modules: false,
publicPath: false,
reasons: false,
source: false,
timings: false,
version: false,
warnings: false
}
}) })
} }