Webpack Quick Start
1. Install
bash
pnpm add -D mokupbash
npm install -D mokupbash
yarn add -D mokupbash
bun add -d mokup2. Add the plugin
ts
import { mokupWebpack } from 'mokup/webpack'
const withMokup = mokupWebpack({
entries: {
dir: 'mock',
prefix: '/api',
},
})
export default withMokup({})Use webpack.config.ts or webpack.config.mjs. Published Mokup packages no longer support CommonJS require().
3. Start dev server
Run your webpack dev server:
bash
pnpm webpack servebash
npm exec webpack servebash
yarn webpack servebash
bunx webpack serve4. Verify
http://localhost:8080/api/usershttp://localhost:8080/__mokup
Next
See the full options in Webpack Plugin.