webpack-dashboard让你的webpack具有可视化效果

@GuoYongfeng 2016-11-20 10:12:11发表于 iuap-design/blog

webpack-dashboard让你的webpack具有可视化效果

webpack-dashboard是一个为你的webpack dev server提供dashboard展示的cli工具

抢先预览效果

如何使用

下载

$ npm install webpack-dashboard --save-dev

修改webpack.config.js

// Import the plugin:
var DashboardPlugin = require('webpack-dashboard/plugin');

// If you aren't using express, add it to your webpack configs plugins section:
plugins: [
    new DashboardPlugin()
]

// If you are using an express based dev server, add it with compiler.apply
compiler.apply(new DashboardPlugin());

修改package.json

"scripts": {
    "dev": "webpack-dashboard -- node index.js"
}