Learn how to use the new Webpack Dashboard from Formidable Labs to display a pretty, useful output for monitoring the status of your webpack builds. This command line tool replaces the frequently unhelpful large text dump that webpack generates with a pretty user interface that breaks out useful information and presents it in a way that's easy to understand at a glance.

webpack-middleware:

var path = require('path');
var express = require('express');
var webpack = require('webpack');
var config = require('./webpack.config'); var Dashboard = require("webpack-dashboard");
var DashboardPlugin = require("webpack-dashboard/plugin"); var app = express();
var compiler = webpack(config); var dashboard = new Dashboard();
compiler.apply(new DashboardPlugin(dashboard.setData)); app.use(express.static('public'));
app.use(require('webpack-dev-middleware')(compiler, {
quiet: true
})); app.listen(8080, "127.0.0.1", function(err) {
if (err) {
console.log(err);
return;
} console.log('Listening at http://localhost:8080');
});

webpack-dev-server:

var Dashboard = require('webpack-dashboard');
var DashboardPlugin = require('webpack-dashboard/plugin');
var dashboard = new Dashboard(); module.exports = {
entry: './main.js',
output: {
path: './',
filename: "index.js"
},
devServer: {
inline: true,
port: 3336,
quite: true, // Add quite option for webpack dashboard
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel',
query: {
presets: ['es2015', 'react']
}
}
]
},
plugins: [
new DashboardPlugin(dashboard.setData)
]
};

[Webpack] Use the Webpack Dashboard to Monitor Webpack Operations的更多相关文章

  1. webpack入门(二)what is webpack

    webpack is a module bundler.webpack是一个模块打包工具,为了解决上篇一提到的各种模块加载或者转换的问题. webpack takes modules with dep ...

  2. Webpack+React项目入门——入门及配置Webpack

    一.入门Webpack 参考文章:<入门Webpack,看这篇就够了> 耐心看完这篇非常有帮助 二.React+Webpack环境配置 参考文章:<webpack+react项目初体 ...

  3. webpack构建多页面react项目(webpack+typescript+react)

    目录介绍 src:里面的每个文件夹就是一个页面,页面开发相关的组件.图片和样式文件就存放在对应的文件夹下. tpl:里面放置模板文件,当webpack打包时为html-webpack-plugin插件 ...

  4. webpack安装低于4版本(没有配置webpack.config.js)

    webpack安装低于4版本(没有配置webpack.config.js) webpack 无需配置输出参数-o 低版本  1.初始化项目 npm init -y 初始化项目 2.安装webpack@ ...

  5. Webpack学习笔记一:What is webpack

      #,Loaders干嘛的,webpack can only process JavaScript natively, but loaders are used to transform other ...

  6. webpack笔记_(2)_Refusing to install webpack as a dependency of itself

    安装webpack时,出现以下问题: Refusing to install webpack as a dependency of itself npm ERR! Windows_NT npm ERR ...

  7. webpack需要全局安装,才能使用webpack命令

    webpack全局安装,具体项目中才能使用webpack命令: npm install webpack -g

  8. [Webpack 2] Expose modules to dependencies with Webpack

    When you have a dependency that has dependencies on global variables (like jQuery or lodash) or assu ...

  9. [Webpack 2] Grouping vendor files with the Webpack CommonsChunkPlugin

    Often, you have dependencies which you rarely change. In these cases, you can leverage the CommonsCh ...

随机推荐

  1. linux 查看外网IP

    curl http://iframe.ip138.com/ic.asp curl ifconfig.me curl http://members.3322.org/dyndns/getip

  2. Linux power supply class hacking

    /*************************************************************************** * Linux power supply cl ...

  3. Spring编程风格

    给自己使用的无需定义接口:即一个模块内部的都是封装的,定义接口并不会得到很多好处,变过几次实现?? “优先面向接口编程,而非实现” 不是必须,是优先: 给朋友(第三方)使用的定义接口:即要公开的功能, ...

  4. Hibernate配置文件解释

    Hibernate配置文件主要用于配置数据库连接和Hibernate运行时所需的各种属性每个Hibernate配置文件对应一个Configuration对象Hibernate配置文件可以有两种格式: ...

  5. Swift的字符串String是值类型

    根据<The Swift Programming Language>中文版基于Xcode6.1的文章描述: Swift的 String 类型是值类型.如果创建了新的字符串,那么当其进行常量 ...

  6. Robotium自动化测试报告生成

    使用Robotium进行测试的时候,要想可以导出可视的测试结果,可以使用junitreport来实现junitreport下载地址:https://github.com/jsankey/android ...

  7. 2015年10月23日JS笔记

    ECMAScript标准:JavaScript核心语法 微软:Jscript ECMAScript标准:一纸空文 JavaScript和JScritp都号称完全实现了 ECMAScript标准 W3C ...

  8. python 中 struct 用法

    下面就介绍这个模块中的几个方法. struct.pack():我的理解是,python利用 struct模块将字符(比如说 int,long ,unsized int 等)拆成 字节流(用十六进制表示 ...

  9. 拉格朗日对偶(Lagrange duality)

    拉格朗日对偶(Lagrange duality) 存在等式约束的极值问题求法,比如下面的最优化问题:              目标函数是f(w),下面是等式约束.通常解法是引入拉格朗日算子,这里使用 ...

  10. 让你系统认识flume及安装和使用flume1.5传输数据到hadoop2.2

    本文链接: http://www.aboutyun.com/thread-7949-1-1.html 问题导读:1.什么是flume?2.如何安装flume?3.flume的配置文件与其它软件有什么不 ...