webpack-dev-koa-middleware

1.0.3 • Public • Published

webpack-dev-koa-middleware

The dev middleware for webpack 4.x

How to use ?

const koaDevMiddleware = require('webpack-dev-koa-middleware')

const config = {} // your's webpack config

const compiler = webpack(config)

const devMiddleware = koaDevMiddleware(compiler, {
  publicPath: clientConfig.output.publicPath,
  logLevel: 'silent'
})

compiler.plugin('done', (stats) => {
  // stats and errors code ...
  
  // for example: vue ssr ready manifest to memoryfs
  clientManifest = JSON.parse(readFile(
    // Here, you can use the fileSystem
    devMiddleware.fileSystem,
    'vue-ssr-client-manifest.json'
  ))
  
  update()
})

app.use(devMiddleware.middleware)

Dependents (1)

Package Sidebar

Install

npm i webpack-dev-koa-middleware

Weekly Downloads

0

Version

1.0.3

License

ISC

Unpacked Size

1.75 kB

Total Files

3

Last publish

Collaborators

  • maxlasting