vite-plugin-mock-data 4.0.1 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/index.d.ts +15 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,6 +27,7 @@ npm install vite-plugin-mock-data --save-dev
|
|
|
27
27
|
### Specify the directory to define mock assets
|
|
28
28
|
|
|
29
29
|
```js
|
|
30
|
+
import { defineConfig } from 'vite';
|
|
30
31
|
import mockData from 'vite-plugin-mock-data';
|
|
31
32
|
|
|
32
33
|
export default defineConfig({
|
|
@@ -60,6 +61,7 @@ fetch('/test.json')
|
|
|
60
61
|
### add mock routes to the dev server
|
|
61
62
|
|
|
62
63
|
```js
|
|
64
|
+
import { defineConfig } from 'vite';
|
|
63
65
|
import mockData from 'vite-plugin-mock-data';
|
|
64
66
|
|
|
65
67
|
export default defineConfig({
|
|
@@ -102,6 +104,7 @@ fetch('/package.json')
|
|
|
102
104
|
### Specify the directory to add mock routes to the dev server
|
|
103
105
|
|
|
104
106
|
```js
|
|
107
|
+
import { defineConfig } from 'vite';
|
|
105
108
|
import mockData from 'vite-plugin-mock-data';
|
|
106
109
|
|
|
107
110
|
export default defineConfig({
|
package/dist/index.d.ts
CHANGED
|
@@ -31,6 +31,21 @@ export interface Options {
|
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* Provides a simple way to mock data.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```js
|
|
37
|
+
* import { defineConfig } from 'vite';
|
|
38
|
+
* import mockData from 'vite-plugin-mock-data';
|
|
39
|
+
*
|
|
40
|
+
* export default defineConfig({
|
|
41
|
+
* plugins: [
|
|
42
|
+
* mockData({
|
|
43
|
+
* mockRoutesDir: './mock'
|
|
44
|
+
* })
|
|
45
|
+
* ]
|
|
46
|
+
* });
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
34
49
|
* @param opts Options
|
|
35
50
|
* @returns a vite plugin
|
|
36
51
|
*/
|