vite-plugin-mocks
v1.0.1
Published
File system for Vite
Downloads
10
Readme
vite-plugin-mocks
mock plugin for Vite plugin.
useage
import MockPlugin from "vite-plugin-mocks";
export default defineConfig({
plugins: [
MockPlugin({
dir: "/mock/",
delay: [0, 300]
})
]
});
| option | type | description | default | necessary |
| ---------- | --------------- | ----------------------------------------------------- | -------------- | --------- |
| dir | string | mock file folder | '/mock/'
| no |
| prefix | string | prefix pattern for url | '/api/'
| no |
| delay | [number,number] | random delay range | [0, 300]
| no |
| extensions | string[] | search file extension | ['ts', 'js']
| no |
| include | string[] | include file match string,syntax reference micromatch | []
| no |
| exclude | string[] | exclude file match string,syntax reference micromatch | []
| no |
License
MIT License © 2021 morelearn1990