0.1.12 • Published 7 years ago

koa-hot-dev-webpack v0.1.12

Weekly downloads
7
License
MIT
Repository
github
Last release
7 years ago

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.

0.1.12

7 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago