koa-hot-dev-webpack
webpack-dev-middleware and webpack-hot-middleware with good defaults for fast setup of koa dev servers
Last updated 9 years ago by paulpflug .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install koa-hot-dev-webpack 
SYNC missed versions from official npm registry.

koa-hot-dev-webpack

Why?

Because there are not enough webpack middleware for koa out there

What?

webpack-dev-middleware and webpack-hot-middleware with good defaults for fast setup of koa dev servers.

How?

Install

npm install --save koa-hot-dev-webpack webpack

Usage

koaHotDevWebpack = require("koa-hot-dev-webpack")
koa.use(koaHotDevWebpack(webpackConfig,middlewareOptions))
// webpackConfig is mandatory

It will add the following plugins:

// for Webpack 1
new webpack.optimize.OccurenceOrderPlugin()
new webpack.NoErrorsPlugin()
new webpack.HotModuleReplacementPlugin()
// for Webpack 2
new webpack.NoEmitOnErrorsPlugin()
new webpack.HotModuleReplacementPlugin()

and inject webpack-hot-middleware/client to all entry points

middlewareOptions defaults are

{
  publicPath: webpackConfig.output.publicPath || "/"
  noInfo: true
  stats: { colors:true }
}

API

All only work for the last instance created!

koaHotDevWebpack.invalidate() // to invalidate the bundle
koaHotDevWebpack.reload() // to reload client side
koaHotDevWebpack.close() // to close webpack

License

Copyright (c) 2016 Paul Pflugradt Licensed under the MIT license.

Current Tags

  • 0.1.12                                ...           latest (9 years ago)

13 Versions

  • 0.1.12                                ...           9 years ago
  • 0.1.11                                ...           9 years ago
  • 0.1.10                                ...           9 years ago
  • 0.1.9                                ...           9 years ago
  • 0.1.8                                ...           9 years ago
  • 0.1.7                                ...           9 years ago
  • 0.1.6                                ...           9 years ago
  • 0.1.5                                ...           9 years ago
  • 0.1.4                                ...           9 years ago
  • 0.1.3                                ...           9 years ago
  • 0.1.2                                ...           9 years ago
  • 0.1.1                                ...           9 years ago
  • 0.1.0                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (4)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |