Skip to content

Combine Setup for Efficiency #27

Description

@shellscape

I'd like to request refactoring to combine all of the setup between dev-middleware and hot-middleware. I've never seen an example where they aren't app.use'd in succession, and given that their options are distinct this should be a trivial refactor:

import packWare from 'koa-webpack-middleware';

app.use(packWare({
  dev: // dev options,
  hot: // hot options,
  compiler: // optional webpack instance,
  config: // optional webpack config. should look for webpack.config.js in root by default
]);

webpack can be imported via a peerDependency entry for the webpack module in package.json, or provided as part of the config of the middleware. This negates the need to set that portion up manually for each use of koa-webpack-middleware.

If you're open to this change, I'll put together a pull request. I'd also be happy to provide an example for Vue.js.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions