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