unplugin-mockup
v0.0.1
Published
mockup
Downloads
1
Maintainers
Readme
unplugin-mockup
Install
npm i unplugin-mockup
// vite.config.ts
import Mock from 'unplugin-mockup/vite'
export default defineConfig({
plugins: [
Mock({
/* options */
}),
],
})
Example: playground/
// rollup.config.js
import Mock from 'unplugin-mockup/rollup'
export default {
plugins: [
Mock({
/* options */
}),
],
}
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-mockup/webpack')({
/* options */
}),
],
}
// nuxt.config.js
export default {
buildModules: [
[
'unplugin-mockup/nuxt',
{
/* options */
},
],
],
}
This module works for both Nuxt 2 and Nuxt Vite
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('unplugin-mockup/webpack')({
/* options */
}),
],
},
}
// esbuild.config.js
import { build } from 'esbuild'
import Mock from 'unplugin-mockup/esbuild'
build({
plugins: [Mock()],
})
Guide
To test plugin, run: pnpm run dev
To release a new version, run: pnpm run release