Skip to content

tnnevol/webpack-dev-middleware-for-koa2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webpack-dev-middleware-for-koa

webpack dev middleware for koa 2.x.

Usage

const app = require('koa')();
const webpackMiddleware = require("webpack-dev-middleware-for-koa2");
app.use(webpackMiddleware(...));

Example usage

const app = require('koa')();
app.use(webpackMiddleware(webpack({
    // webpack options
    // webpackMiddleware takes a Compiler object as first parameter
    // which is returned by webpack(...) without callback.
    entry: "...",
    output: {
        path: "/"
        // no real path is required, just pass "/"
        // but it will work with other paths too.
    }
}), {
    // all options optional
      publicPath: webpackDevConfig.output.publicPath, // 增加路由访问前缀
      logLevel: "error",
}));

About

用于koa2的webpack-dev-middleware的中间件

Resources

Stars

Watchers

Forks

Packages

No packages published