mix-webpack-plugin

0.0.1 • Public • Published

mix-webpack-plugin

npm version

Motivation

This plugin is inspired by 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

Install

npm i mix-webpack-plugin -D

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

Usage

// webpack.config.js

{
  plugins: [
    // ...
    new MixWebpackPlugin({
      handler: './server/handler.js'
    })
 ],
}
// handler.js
const handler = async (req, res, next) => {
  if (req.path === '/id') {
    res.end('hello world')
    return
  }
  next()
}

module.exports = {handler}

License

MIT @ brandonxiang

Readme

Keywords

none

Package Sidebar

Install

npm i mix-webpack-plugin

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

6.54 kB

Total Files

5

Last publish

Collaborators

  • brandonxiang