# mix-webpack-plugin

> [![npm version](https://badgen.net/npm/v/mix-webpack-plugin)](https://npm.im/mix-webpack-plugin)

Latest version **0.0.1** (published 2023-03-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install mix-webpack-plugin
pnpm add mix-webpack-plugin
yarn add mix-webpack-plugin
bun add mix-webpack-plugin
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2023-03-11 |
| First published | 2023-03-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | brandonxiang |

## Links

- npm: https://www.npmjs.com/package/mix-webpack-plugin
- npm.io page: https://npm.io/package/mix-webpack-plugin

## Dependencies (4)

- [sirv](https://npm.io/package/sirv.md) ^2.0.2
- [polka](https://npm.io/package/polka.md) ^0.5.2
- [webpack](https://npm.io/package/webpack.md) ^5.0.0
- [webpack-node-externals](https://npm.io/package/webpack-node-externals.md) ^3.0.0

## Recent versions

- 0.0.1 (latest) — 2023-03-11

## README

# mix-webpack-plugin

[![npm version](https://badgen.net/npm/v/mix-webpack-plugin)](https://npm.im/mix-webpack-plugin)

## Motivation

This plugin is inspired by [vite-plugin-mix](https://github.com/egoist/vite-plugin-mix), which help you to write the front-end and back-end API in the single project, this plugin brings you Nextjs DX to your webpack app.

![desp](./assets/desp.png)

## Install

```bash
npm i mix-webpack-plugin -D

npm i webpack webpack-cli webpack-dev-server -D
```

## Usage

```javascript
// webpack.config.js

{
  plugins: [
    // ...
    new MixWebpackPlugin({
      handler: './server/handler.js'
    })
 ],
}
```

``` javascript
// handler.js
const handler = async (req, res, next) => {
  if (req.path === '/id') {
    res.end('hello world')
    return
  }
  next()
}

module.exports = {handler}
```

## License

MIT @ [brandonxiang](./LICENSE)

---
_Source: https://npm.io/package/mix-webpack-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
