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. c# 产生随机字符串,包括大小写字母和数字

    #region MyRegion //產生密碼 protected static string GetPwd() { return CreateRandomNum123(2) + CreateRand ...

  2. UVa 10900 (连续概率、递推) So you want to be a 2n-aire?

    题意: 初始奖金为1块钱,有n个问题,连续回答对i个问题后,奖金变为2i元. 回答对每道题的概率在t~1之间均匀分布. 听到问题后有两个选择: 放弃回答,拿走已得到的奖金 回答问题: 如果回答正确,奖 ...

  3. java.sql.DataTruncation: Data truncation

    问题一: 用jdbc插入数据时,当数据库表中某列设置的长度小于要插入的字符的实际长度时就会抛出此异常. 如:数据表中某列char [4],长度为4,插入:"Hello"时,字符&q ...

  4. idea开发工具中你可能不知道的却又比较好用的快捷键

    Alt+insert :生成代码 较为常用的是 1.普通Class中生成get set 方法 .生成构造函数.生成spring注入.重写对象的equal.toString.hashcode方法 2.如 ...

  5. windows内核初窥(二)-----系统机制

    系统机制: windows2000为执行体.内核.设备驱动程序等核心态部分提供了一些基础机制.先让我们看看都有哪些: (1)陷阱调度:包括中断.延迟过程调用(DPC).异步过程调用(APC).异常处理 ...

  6. JAVA面试题——JAVA基础篇

    1.JAVA多态的实现方式:继承.重载.覆盖 2.JAVA有8种基本数据类型:byte.short.int.long.float.double.boolean.char 3.final.finally ...

  7. 洛谷 P1169 [ZJOI2007]棋盘制作

    2016-05-31 14:56:17 题目链接: 洛谷 P1169 [ZJOI2007]棋盘制作 题目大意: 给定一块矩形,求出满足棋盘式黑白间隔的最大矩形大小和最大正方形大小 解法: 神犇王知昆的 ...

  8. SQL2008-查询库中是否存在某表

    select   *   from   sysobjects   where   name= 'N201111B'   and   xtype= 'U'

  9. python 使用__future__

    Python的每个新版本都会增加一些新的功能,或者对原来的功能作一些改动.有些改动是不兼容旧版本的,也就是在当前版本运行正常的代码,到下一个版本运行就可能不正常了. 从Python 2.7到Pytho ...

  10. SQL Server 2008数据库创建,备份,还原图解及注意点

    一.新建数据库 步骤1:点击“新建数据库”. 步骤2:输入数据库名称,设置数据库文件保存位置(注意点:最好自己设置数据库文件保存位置,不要采用安装时默认的文件保存位置!),点击“确认”即可完成新库的创 ...