Skip to content

Commit a6a9dac

Browse files
committed
Added webpack-dashboard for local dev-mode
1 parent 9839c52 commit a6a9dac

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@
133133
"style-loader": "^0.13.0",
134134
"watch": "^0.18.0",
135135
"webpack": "^1.9.6",
136+
"webpack-dashboard": "0.0.1",
136137
"webpack-dev-server": "^1.14.0"
137138
},
138139
"dependencies": {

webpack.config.dev.js

+15-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const autoprefixer = require('autoprefixer')
33
const path = require('path')
44
const webpack = require('webpack')
55

6-
module.exports = {
6+
const config = {
77
devtool: 'eval',
88
entry: {
99
demo: './source/demo/Application'
@@ -45,6 +45,19 @@ module.exports = {
4545
},
4646
devServer: {
4747
contentBase: 'build',
48-
port: 3001
48+
port: 3001,
49+
quiet: true
4950
}
5051
}
52+
53+
if (process.env.NODE_ENV === 'development') {
54+
const Dashboard = require('webpack-dashboard')
55+
const DashboardPlugin = require('webpack-dashboard/plugin')
56+
const dashboard = new Dashboard()
57+
58+
config.plugins.push(
59+
new DashboardPlugin(dashboard.setData)
60+
)
61+
}
62+
63+
module.exports = config

0 commit comments

Comments
 (0)