Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

koa-webpack-dev

kitmi5MIT1.0.6

A koa middleware works as development server for webpack.

koa, middleware, webpack, development, server

readme

koa-webpack-dev

A koa middleware works as development server for webpack. Well tested.

Usage

  • Koa v1.x

      const webpackDevServer = require('koa-webpack-dev');
      app.use(webpackDevServer(settings));

Install

npm install koa-webpack-dev

Features

  • Can be integrated into your koa application as easy as using a serveStatic middleware. Just don't use it in production mode.

Example

var koa = require('koa');
var webpackDevServer = require('koa-webpack-dev');
var app = koa();

app.use(webpackDevServer({
    config: './webpack.config.js'
}));

app.listen(2333);

Settings

  • options:
    • config: can be the content of webpack.config.js or a string specified the path of webpack.config.js
    • watchOptions: options to be passed into the watch api of webpack. webpack#watching
    • defaultPage: default entry page for url mapped to a directory. default: index.html
    • webRoot: web root path. default: build path

Licences

MIT

changelog

1.0.0 / 2016-01-02

  • initial release

1.0.1 / 2016-01-03

  • fix relative config path resolving and add a web root option
  • remove underscore dependency
  • add memory-fs dependency

1.0.2 / 2016-01-12

  • publish new version to npm to include previous fix

1.0.3 / 2016-05-13

  • Add webpack-config-options feature

1.0.6 / 2016-09-27

  • Add webpack-config-options into optionalDependencies