Webpack dashboard

This commit is contained in:
Josh Johnson 2016-08-17 13:27:37 +01:00
parent 0220f363a7
commit d099c17f68
3 changed files with 7 additions and 1 deletions

View file

@ -53,6 +53,7 @@
"opn-cli": "^3.1.0", "opn-cli": "^3.1.0",
"postcss-cli": "^2.5.1", "postcss-cli": "^2.5.1",
"webpack": "^1.12.14", "webpack": "^1.12.14",
"webpack-dashboard": "0.0.1",
"webpack-dev-server": "^1.14.1", "webpack-dev-server": "^1.14.1",
"whatwg-fetch": "^1.0.0", "whatwg-fetch": "^1.0.0",
"wrapper-webpack-plugin": "^0.1.7" "wrapper-webpack-plugin": "^0.1.7"

View file

@ -6,6 +6,7 @@ var opn = require('opn');
new WebpackDevServer(webpack(config), { new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath, publicPath: config.output.publicPath,
historyApiFallback: true, historyApiFallback: true,
quiet: true, // lets WebpackDashboard do its thing
}).listen(3000, 'localhost', function (err, result) { }).listen(3000, 'localhost', function (err, result) {
if (err) console.log(err); if (err) console.log(err);
opn('http://localhost:3000'); opn('http://localhost:3000');

View file

@ -1,5 +1,8 @@
var path = require('path'); var path = require('path');
var webpack = require('webpack'); var webpack = require('webpack');
var Dashboard = require('webpack-dashboard');
var DashboardPlugin = require('webpack-dashboard/plugin');
var dashboard = new Dashboard();
module.exports = { module.exports = {
devtool: 'eval', devtool: 'eval',
@ -10,12 +13,13 @@ module.exports = {
output: { output: {
path: path.join(__dirname, 'dist'), path: path.join(__dirname, 'dist'),
filename: 'choices.min.js', filename: 'choices.min.js',
publicPath: '/assets/scripts/dist/' publicPath: '/assets/scripts/dist/',
}, },
eslint: { eslint: {
configFile: '.eslintrc' configFile: '.eslintrc'
}, },
plugins: [ plugins: [
new DashboardPlugin(dashboard.setData),
new webpack.HotModuleReplacementPlugin(), new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({ new webpack.DefinePlugin({
'process.env': { 'process.env': {