1.0.1 • Published 4 years ago

vite-plugin-mocks v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

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]
        })
    ]
});
optiontypedescriptiondefaultnecessary
dirstringmock file folder'/mock/'no
prefixstringprefix pattern for url'/api/'no
delaynumber,numberrandom delay range[0, 300]no
extensionsstring[]search file extension['ts', 'js']no
includestring[]include file match string,syntax reference micromatch[]no
excludestring[]exclude file match string,syntax reference micromatch[]no

License

MIT License © 2021 morelearn1990