/vite-plugin-mocks

mocks plugin for vite

Primary LanguageTypeScriptMIT LicenseMIT

vite-plugin-mocks

npm version monthly downloads types license

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