8000 GitHub - paulpflug/koa-hot-dev-webpack: webpack-dev-middleware and webpack-hot-middleware with good defaults for fast setup of koa dev servers
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Notifications You must be signed in to change notification settings

paulpflug/koa-hot-dev-webpack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published
0