vite-plugin-mock-dev-server 1.0.4 → 1.0.6
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 +56 -58
- package/README.zh-CN.md +6 -10
- package/dist/index.cjs +5 -8
- package/dist/index.js +11 -14
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -26,21 +26,21 @@
|
|
|
26
26
|
|
|
27
27
|
## Feature
|
|
28
28
|
|
|
29
|
-
- ⚡️ light weight,flexible,fast
|
|
30
|
-
- 🧲
|
|
31
|
-
- 💡 ESModule/commonjs
|
|
32
|
-
- 🦾 Typescript
|
|
33
|
-
- 🏷 Support json / json5
|
|
34
|
-
- 📦 Auto import mock file
|
|
29
|
+
- ⚡️ light weight,flexible,fast.
|
|
30
|
+
- 🧲 Not injection-based, non-intrusive to client code.
|
|
31
|
+
- 💡 ESModule/commonjs.
|
|
32
|
+
- 🦾 Typescript.
|
|
33
|
+
- 🏷 Support `json` / `json5`.
|
|
34
|
+
- 📦 Auto import mock file.
|
|
35
35
|
- 🎨 Support any lib,like `mockjs`,or not use it.
|
|
36
|
-
- 📥 Path
|
|
36
|
+
- 📥 Path rule matching, request parameter matching.
|
|
37
37
|
- ⚙️ Support Enabled/Disabled any one of api mock
|
|
38
38
|
- 🔥 HMR
|
|
39
39
|
- ⚖️ Use `server.proxy`
|
|
40
40
|
- 🍕 Support `viteConfig.define` in mock file
|
|
41
41
|
- 📤 Support `multipart` content-type,mock upload file.
|
|
42
42
|
- 🌈 Support `vite preview` mode
|
|
43
|
-
- 🗂 Support
|
|
43
|
+
- 🗂 Support building small independent deployable mock services.
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
## Documentation
|
|
@@ -77,6 +77,7 @@ export default defineConfig({
|
|
|
77
77
|
plugins: [
|
|
78
78
|
mockDevServerPlugin(),
|
|
79
79
|
],
|
|
80
|
+
// The fields defined here can also be used in mock.
|
|
80
81
|
define: {},
|
|
81
82
|
server: {
|
|
82
83
|
proxy: {
|
|
@@ -87,15 +88,17 @@ export default defineConfig({
|
|
|
87
88
|
}
|
|
88
89
|
})
|
|
89
90
|
```
|
|
90
|
-
The plugin
|
|
91
|
+
The plugin will read the configuration of `server.proxy` or `options.prefix`, and enable mock matching for matched URLs.
|
|
91
92
|
|
|
92
|
-
The plugin also
|
|
93
|
+
The plugin will also read the `define` configuration, which supports direct use in mock files.
|
|
93
94
|
|
|
94
|
-
>
|
|
95
|
+
> Because in general scenarios, we only need to mock URLs with proxies so that we can use the proxy and mock services provided by Vite's HTTP service.
|
|
96
|
+
>
|
|
97
|
+
> However, you can also configure mocks using `options.prefix`.
|
|
95
98
|
|
|
96
99
|
### Edit Mock File
|
|
97
100
|
|
|
98
|
-
By default, write mock data in the `mock` directory of your project root:
|
|
101
|
+
By default, write mock data in the `mock` directory of your project's root directory:
|
|
99
102
|
|
|
100
103
|
`mock/api.mock.ts` :
|
|
101
104
|
```ts
|
|
@@ -135,9 +138,9 @@ export default defineConfig({
|
|
|
135
138
|
|
|
136
139
|
**Type:** `string | string[]`
|
|
137
140
|
|
|
138
|
-
Configure custom
|
|
141
|
+
Configure custom matching rules for mock server. Any request path starting with the value of `prefix` will be proxied to the corresponding target. If the `prefix` value starts with ^, it will be recognized as a RegExp.
|
|
139
142
|
|
|
140
|
-
> In general, `server.proxy` is sufficient to meet the
|
|
143
|
+
> In general, `server.proxy` is sufficient to meet the needs. Adding this item is for compatibility with certain scenarios.
|
|
141
144
|
|
|
142
145
|
**Default:** `[]`
|
|
143
146
|
|
|
@@ -145,25 +148,22 @@ export default defineConfig({
|
|
|
145
148
|
|
|
146
149
|
**Type:** `string | string[]`
|
|
147
150
|
|
|
148
|
-
Configure to read mock files, which can be a directory, glob, or array
|
|
151
|
+
Configure to read mock files, which can be a directory, glob, or an array.
|
|
149
152
|
|
|
150
|
-
**Default:** `['mock/**/*.mock.{js,ts,cjs,mjs,json,json5}']` (
|
|
153
|
+
**Default:** `['mock/**/*.mock.{js,ts,cjs,mjs,json,json5}']` (Relative to the root directory.)
|
|
151
154
|
|
|
152
155
|
- `options.exclude`
|
|
153
156
|
|
|
154
157
|
**Type:** `string | string[]`
|
|
155
158
|
|
|
156
|
-
When
|
|
159
|
+
When reading mock files for configuration, the files that need to be excluded can be a directory, glob, or an array.
|
|
157
160
|
|
|
158
161
|
**Default:**
|
|
159
162
|
```ts
|
|
160
163
|
[
|
|
161
164
|
'**/node_modules/**',
|
|
162
|
-
'**/test/**',
|
|
163
|
-
'src/**',
|
|
164
165
|
'**/.vscode/**',
|
|
165
166
|
'**/.git/**',
|
|
166
|
-
'**/dist/**'
|
|
167
167
|
]
|
|
168
168
|
```
|
|
169
169
|
|
|
@@ -171,8 +171,7 @@ export default defineConfig({
|
|
|
171
171
|
|
|
172
172
|
**Type:** `boolean`
|
|
173
173
|
|
|
174
|
-
When mock
|
|
175
|
-
Turn this on when you want to refresh the page every time you modify the mock file.
|
|
174
|
+
When the mock resource is hot updated, only the data content is updated, but the page is not refreshed by default. If you want to refresh the page every time you modify the mock file, you can open this option.
|
|
176
175
|
|
|
177
176
|
|
|
178
177
|
**Default:** `false`
|
|
@@ -194,7 +193,7 @@ export default defineConfig({
|
|
|
194
193
|
|
|
195
194
|
- `options.build`
|
|
196
195
|
|
|
197
|
-
|
|
196
|
+
Configuration needed to build a small, independently deployable mock service.
|
|
198
197
|
|
|
199
198
|
**Type:** `boolean | ServerBuildOptions`
|
|
200
199
|
|
|
@@ -233,11 +232,11 @@ export default defineMock({
|
|
|
233
232
|
```ts
|
|
234
233
|
export default defineMock({
|
|
235
234
|
/**
|
|
236
|
-
*
|
|
235
|
+
* Request address, supports the `/api/user/:id` format.
|
|
237
236
|
*/
|
|
238
237
|
url: '/api/test',
|
|
239
238
|
/**
|
|
240
|
-
*
|
|
239
|
+
* Supported request methods of the interface.
|
|
241
240
|
*
|
|
242
241
|
* @type string | string[]
|
|
243
242
|
* @default ['POST','GET']
|
|
@@ -245,16 +244,17 @@ export default defineMock({
|
|
|
245
244
|
*/
|
|
246
245
|
method: ['GET', 'POST'],
|
|
247
246
|
/**
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
|
-
*
|
|
247
|
+
* In practical scenarios,
|
|
248
|
+
* we usually only need certain mock interfaces to take effect,
|
|
249
|
+
* rather than enabling all mock interfaces.
|
|
250
|
+
* For interfaces that do not currently require mocking,
|
|
251
|
+
* they can be set to false.
|
|
252
252
|
*
|
|
253
253
|
* @default true
|
|
254
254
|
*/
|
|
255
255
|
enable: true,
|
|
256
256
|
/**
|
|
257
|
-
* response delay
|
|
257
|
+
* Set interface response delay, unit: ms.
|
|
258
258
|
*
|
|
259
259
|
* @default 0
|
|
260
260
|
*/
|
|
@@ -270,27 +270,23 @@ export default defineMock({
|
|
|
270
270
|
*/
|
|
271
271
|
statusText: 'OK',
|
|
272
272
|
/**
|
|
273
|
-
* Request
|
|
274
|
-
* is
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
*
|
|
278
|
-
* It divides the same url into multiple mock
|
|
279
|
-
* configurations and determines which mock configuration
|
|
280
|
-
* is valid according to the validator.
|
|
273
|
+
* Request validator, return mock data if validated, otherwise do not use current mock.
|
|
274
|
+
* This is useful in scenarios where an interface needs to return different data based
|
|
275
|
+
* on different input parameters.
|
|
276
|
+
* Validators can solve this type of problem well by dividing the same URL into multiple
|
|
277
|
+
* mock configurations and determining which one is effective based on the validator.
|
|
281
278
|
*
|
|
282
279
|
* @type { headers?: object; body?: object; query?: object; params?: object; refererQuery?: object }
|
|
283
280
|
*
|
|
284
|
-
* If the validator
|
|
285
|
-
* then the validation method is
|
|
286
|
-
*
|
|
287
|
-
*
|
|
281
|
+
* If the validator passes in an object,
|
|
282
|
+
* then the validation method is to strictly compare whether the `value`
|
|
283
|
+
* of each `key` in headers/body/query/params in the request interface is exactly equal.
|
|
284
|
+
* If they are all equal, then the validation passes.
|
|
288
285
|
*
|
|
289
286
|
* @type ({ headers: object; body: object; query: object; params: object; refererQuery: object }) => boolean
|
|
290
|
-
* If the validator is
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
* and returns a boolean
|
|
287
|
+
* If the validator passed in is a function,
|
|
288
|
+
* then the data related to the requested interface will be provided as input parameters
|
|
289
|
+
* for users to perform custom validation and return a boolean.
|
|
294
290
|
*
|
|
295
291
|
*/
|
|
296
292
|
validator: {
|
|
@@ -299,9 +295,9 @@ export default defineMock({
|
|
|
299
295
|
query: {},
|
|
300
296
|
params: {},
|
|
301
297
|
/**
|
|
302
|
-
* refererQuery validates the query in the
|
|
303
|
-
* which
|
|
304
|
-
* different
|
|
298
|
+
* refererQuery validates the query parameters in the URL of the request source page,
|
|
299
|
+
* which allows for direct modification of parameters in the browser address bar
|
|
300
|
+
* to obtain different simulated data.
|
|
305
301
|
*/
|
|
306
302
|
refererQuery: {}
|
|
307
303
|
},
|
|
@@ -329,9 +325,11 @@ export default defineMock({
|
|
|
329
325
|
body: {},
|
|
330
326
|
|
|
331
327
|
/**
|
|
332
|
-
* If the mock requirement cannot be
|
|
333
|
-
*
|
|
334
|
-
*
|
|
328
|
+
* If the mock requirement cannot be solved through `body` configuration,
|
|
329
|
+
* then it can be achieved by configuring response and exposing the interface of http server
|
|
330
|
+
* to realize fully controllable custom configuration in req parameters.
|
|
331
|
+
* The parsing of query, body and params has been built-in, so you can use them directly.
|
|
332
|
+
* Don't forget to return response data through `res.end()` or skip mock by calling `next()`.
|
|
335
333
|
*/
|
|
336
334
|
response(req, res, next) {
|
|
337
335
|
res.end()
|
|
@@ -558,11 +556,11 @@ export default defineMock({
|
|
|
558
556
|
|
|
559
557
|
## Mock Services
|
|
560
558
|
|
|
561
|
-
In some scenarios,
|
|
559
|
+
In some scenarios, it may be necessary to use the data provided by mock services for display purposes, but the project may have already been packaged, built and deployed without support from `vite` and this plugin's mock service. Since this plugin supports importing various `node` modules in mock files at the design stage, the mock file cannot be inline into client build code.
|
|
562
560
|
|
|
563
|
-
To
|
|
561
|
+
To meet such scenarios, on one hand, the plugin provides support under `vite preview`, and on the other hand, it also builds a small independent mock service application that can be deployed to relevant environments during `vite build`. This can then be forwarded through other HTTP servers like nginx to actual ports for mock support.
|
|
564
562
|
|
|
565
|
-
|
|
563
|
+
The default output is built into the directory `dist/mockServer`, generating files as follows:
|
|
566
564
|
```sh
|
|
567
565
|
./mockServer
|
|
568
566
|
├── index.js
|
|
@@ -570,11 +568,11 @@ Build the default output into the `dist/mockServer` directory and generate the f
|
|
|
570
568
|
└── package.json
|
|
571
569
|
```
|
|
572
570
|
|
|
573
|
-
In this directory,
|
|
571
|
+
In this directory, execute `npm install` to install dependencies, and then execute `npm start` to start the mock server.
|
|
574
572
|
|
|
575
|
-
default port
|
|
573
|
+
The default port is `8080`.
|
|
576
574
|
|
|
577
|
-
|
|
575
|
+
You can access related `mock` interfaces through `localhost:8080/`.
|
|
578
576
|
|
|
579
577
|
## Archives
|
|
580
578
|
|
package/README.zh-CN.md
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
- 🧲 非注入式,对客户端代码无侵入
|
|
32
32
|
- 💡 ESModule/commonjs
|
|
33
33
|
- 🦾 Typescript
|
|
34
|
-
- 🏷 支持 json / json5 编写 mock 数据
|
|
34
|
+
- 🏷 支持 `json` / `json5` 编写 mock 数据
|
|
35
35
|
- 📦 自动加载 mock 文件
|
|
36
36
|
- 🎨 可选择你喜欢的任意用于生成mock数据库,如 `mockjs`,或者不使用其他库
|
|
37
37
|
- 📥 路径规则匹配,请求参数匹配
|
|
@@ -161,11 +161,8 @@ export default defineConfig({
|
|
|
161
161
|
```ts
|
|
162
162
|
[
|
|
163
163
|
'**/node_modules/**',
|
|
164
|
-
'**/test/**',
|
|
165
|
-
'src/**',
|
|
166
164
|
'**/.vscode/**',
|
|
167
165
|
'**/.git/**',
|
|
168
|
-
'**/dist/**'
|
|
169
166
|
]
|
|
170
167
|
```
|
|
171
168
|
|
|
@@ -194,7 +191,7 @@ export default defineConfig({
|
|
|
194
191
|
|
|
195
192
|
- `options.build`
|
|
196
193
|
|
|
197
|
-
|
|
194
|
+
需要构建可独立部署的小型mock服务时配置。
|
|
198
195
|
|
|
199
196
|
**类型:** `boolean | ServerBuildOptions`
|
|
200
197
|
|
|
@@ -271,7 +268,7 @@ export default defineMock({
|
|
|
271
268
|
*/
|
|
272
269
|
statusText: 'OK',
|
|
273
270
|
/**
|
|
274
|
-
* 请求验证器,通过验证器则返回 mock
|
|
271
|
+
* 请求验证器,通过验证器则返回 mock数据,否则不使用当前mock。
|
|
275
272
|
* 这对于一些场景中,某个接口需要通过不同的入参来返回不同的数据,
|
|
276
273
|
* 验证器可以很好的解决这一类问题,将同个 url 分为多个 mock配置,
|
|
277
274
|
* 根据 验证器来判断哪个mock配置生效。
|
|
@@ -292,9 +289,8 @@ export default defineMock({
|
|
|
292
289
|
query: {},
|
|
293
290
|
params: {},
|
|
294
291
|
/**
|
|
295
|
-
* refererQuery
|
|
296
|
-
*
|
|
297
|
-
* different mock data
|
|
292
|
+
* refererQuery 验证了请求来源页面 URL 中的查询参数,
|
|
293
|
+
* 这使得可以直接在浏览器地址栏中修改参数以获取不同的模拟数据。
|
|
298
294
|
*/
|
|
299
295
|
refererQuery: {}
|
|
300
296
|
},
|
|
@@ -571,7 +567,7 @@ export default defineMock({
|
|
|
571
567
|
└── package.json
|
|
572
568
|
```
|
|
573
569
|
|
|
574
|
-
在该目录下,执行 `npm install`
|
|
570
|
+
在该目录下,执行 `npm install` 安装依赖后,执行 `npm start` 即可启动 mock server。
|
|
575
571
|
默认端口为 `8080`。
|
|
576
572
|
可通过 `localhost:8080/` 访问相关的 `mock` 接口。
|
|
577
573
|
|
package/dist/index.cjs
CHANGED
|
@@ -38,7 +38,7 @@ __export(src_exports, {
|
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(src_exports);
|
|
40
40
|
|
|
41
|
-
// node_modules/.pnpm/tsup@6.
|
|
41
|
+
// node_modules/.pnpm/tsup@6.7.0_typescript@5.0.2/node_modules/tsup/assets/cjs_shims.js
|
|
42
42
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
43
43
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
44
44
|
|
|
@@ -53,7 +53,7 @@ var import_vite = require("vite");
|
|
|
53
53
|
|
|
54
54
|
// package.json
|
|
55
55
|
var name = "vite-plugin-mock-dev-server";
|
|
56
|
-
var version = "1.0.
|
|
56
|
+
var version = "1.0.6";
|
|
57
57
|
|
|
58
58
|
// src/esbuildPlugin.ts
|
|
59
59
|
var import_promises = __toESM(require("fs/promises"), 1);
|
|
@@ -215,7 +215,7 @@ async function generateMockServer(ctx, config, options) {
|
|
|
215
215
|
}
|
|
216
216
|
function getMockDependencies(deps) {
|
|
217
217
|
const list = /* @__PURE__ */ new Set();
|
|
218
|
-
const excludeDeps = [name, "connect"];
|
|
218
|
+
const excludeDeps = [name, "connect", "cors"];
|
|
219
219
|
Object.keys(deps).forEach((mPath) => {
|
|
220
220
|
const imports = deps[mPath].imports.filter((_) => _.external).map((_) => _.path);
|
|
221
221
|
imports.forEach((dep) => {
|
|
@@ -273,7 +273,7 @@ async function generateMockEntryCode(cwd, include, exclude) {
|
|
|
273
273
|
let importers = "";
|
|
274
274
|
let exporters = "";
|
|
275
275
|
mockFiles.forEach((filepath, index) => {
|
|
276
|
-
const file = import_node_path3.default.join(cwd, filepath);
|
|
276
|
+
const file = (0, import_vite.normalizePath)(import_node_path3.default.join(cwd, filepath));
|
|
277
277
|
importers += `import * as m${index} from '${file}';
|
|
278
278
|
`;
|
|
279
279
|
exporters += `m${index}, `;
|
|
@@ -794,11 +794,8 @@ function mockDevServerPlugin({
|
|
|
794
794
|
include = ["mock/**/*.mock.{js,ts,cjs,mjs,json,json5}"],
|
|
795
795
|
exclude = [
|
|
796
796
|
"**/node_modules/**",
|
|
797
|
-
"**/test/**",
|
|
798
|
-
"src/**",
|
|
799
797
|
"**/.vscode/**",
|
|
800
|
-
"**/.git/**"
|
|
801
|
-
"**/dist/**"
|
|
798
|
+
"**/.git/**"
|
|
802
799
|
],
|
|
803
800
|
reload = false,
|
|
804
801
|
formidableOptions = {},
|
package/dist/index.js
CHANGED
|
@@ -5,11 +5,11 @@ import path3 from "path";
|
|
|
5
5
|
import { build } from "esbuild";
|
|
6
6
|
import fg from "fast-glob";
|
|
7
7
|
import isCore from "is-core-module";
|
|
8
|
-
import { createFilter } from "vite";
|
|
8
|
+
import { createFilter, normalizePath } from "vite";
|
|
9
9
|
|
|
10
10
|
// package.json
|
|
11
11
|
var name = "vite-plugin-mock-dev-server";
|
|
12
|
-
var version = "1.0.
|
|
12
|
+
var version = "1.0.6";
|
|
13
13
|
|
|
14
14
|
// src/esbuildPlugin.ts
|
|
15
15
|
import fsp from "fs/promises";
|
|
@@ -171,7 +171,7 @@ async function generateMockServer(ctx, config, options) {
|
|
|
171
171
|
}
|
|
172
172
|
function getMockDependencies(deps) {
|
|
173
173
|
const list = /* @__PURE__ */ new Set();
|
|
174
|
-
const excludeDeps = [name, "connect"];
|
|
174
|
+
const excludeDeps = [name, "connect", "cors"];
|
|
175
175
|
Object.keys(deps).forEach((mPath) => {
|
|
176
176
|
const imports = deps[mPath].imports.filter((_) => _.external).map((_) => _.path);
|
|
177
177
|
imports.forEach((dep) => {
|
|
@@ -229,7 +229,7 @@ async function generateMockEntryCode(cwd, include, exclude) {
|
|
|
229
229
|
let importers = "";
|
|
230
230
|
let exporters = "";
|
|
231
231
|
mockFiles.forEach((filepath, index) => {
|
|
232
|
-
const file = path3.join(cwd, filepath);
|
|
232
|
+
const file = normalizePath(path3.join(cwd, filepath));
|
|
233
233
|
importers += `import * as m${index} from '${file}';
|
|
234
234
|
`;
|
|
235
235
|
exporters += `m${index}, `;
|
|
@@ -455,7 +455,7 @@ import chokidar from "chokidar";
|
|
|
455
455
|
import { build as build2 } from "esbuild";
|
|
456
456
|
import fastGlob from "fast-glob";
|
|
457
457
|
import JSON52 from "json5";
|
|
458
|
-
import { createFilter as createFilter2, normalizePath } from "vite";
|
|
458
|
+
import { createFilter as createFilter2, normalizePath as normalizePath2 } from "vite";
|
|
459
459
|
|
|
460
460
|
// src/transform.ts
|
|
461
461
|
import { parse as urlParse2 } from "url";
|
|
@@ -544,17 +544,17 @@ var _MockLoader = class extends EventEmitter {
|
|
|
544
544
|
});
|
|
545
545
|
otherGlob.length > 0 && otherGlob.forEach((glob) => watcher.add(glob));
|
|
546
546
|
watcher.on("add", async (filepath) => {
|
|
547
|
-
filepath =
|
|
547
|
+
filepath = normalizePath2(filepath);
|
|
548
548
|
this.emit("mock:update", filepath);
|
|
549
549
|
debug("watcher:add", filepath);
|
|
550
550
|
});
|
|
551
551
|
watcher.on("change", async (filepath) => {
|
|
552
|
-
filepath =
|
|
552
|
+
filepath = normalizePath2(filepath);
|
|
553
553
|
this.emit("mock:update", filepath);
|
|
554
554
|
debug("watcher:change", filepath);
|
|
555
555
|
});
|
|
556
556
|
watcher.on("unlink", async (filepath) => {
|
|
557
|
-
filepath =
|
|
557
|
+
filepath = normalizePath2(filepath);
|
|
558
558
|
this.emit("mock:unlink", filepath);
|
|
559
559
|
debug("watcher:unlink", filepath);
|
|
560
560
|
});
|
|
@@ -571,14 +571,14 @@ var _MockLoader = class extends EventEmitter {
|
|
|
571
571
|
cwd: this.cwd
|
|
572
572
|
});
|
|
573
573
|
this.depsWatcher.on("change", (filepath) => {
|
|
574
|
-
filepath =
|
|
574
|
+
filepath = normalizePath2(filepath);
|
|
575
575
|
const mockFiles = this.moduleDeps.get(filepath);
|
|
576
576
|
mockFiles && mockFiles.forEach((file) => {
|
|
577
577
|
this.emit("mock:update", file);
|
|
578
578
|
});
|
|
579
579
|
});
|
|
580
580
|
this.depsWatcher.on("unlink", (filepath) => {
|
|
581
|
-
filepath =
|
|
581
|
+
filepath = normalizePath2(filepath);
|
|
582
582
|
this.moduleDeps.delete(filepath);
|
|
583
583
|
});
|
|
584
584
|
this.on("update:deps", () => {
|
|
@@ -750,11 +750,8 @@ function mockDevServerPlugin({
|
|
|
750
750
|
include = ["mock/**/*.mock.{js,ts,cjs,mjs,json,json5}"],
|
|
751
751
|
exclude = [
|
|
752
752
|
"**/node_modules/**",
|
|
753
|
-
"**/test/**",
|
|
754
|
-
"src/**",
|
|
755
753
|
"**/.vscode/**",
|
|
756
|
-
"**/.git/**"
|
|
757
|
-
"**/dist/**"
|
|
754
|
+
"**/.git/**"
|
|
758
755
|
],
|
|
759
756
|
reload = false,
|
|
760
757
|
formidableOptions = {},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-mock-dev-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"vite",
|
|
6
6
|
"plugin",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"chokidar": "^3.5.3",
|
|
34
34
|
"co-body": "^6.1.0",
|
|
35
35
|
"debug": "^4.3.4",
|
|
36
|
-
"esbuild": "^0.17.
|
|
36
|
+
"esbuild": "^0.17.12",
|
|
37
37
|
"fast-glob": "^3.2.12",
|
|
38
38
|
"formidable": "^2.1.1",
|
|
39
39
|
"http-status": "^1.6.2",
|
|
@@ -49,16 +49,16 @@
|
|
|
49
49
|
"@types/debug": "^4.1.7",
|
|
50
50
|
"@types/formidable": "^2.0.5",
|
|
51
51
|
"@types/is-core-module": "^2.2.0",
|
|
52
|
-
"@types/node": "^18.
|
|
52
|
+
"@types/node": "^18.15.5",
|
|
53
53
|
"bumpp": "^9.0.0",
|
|
54
54
|
"conventional-changelog-cli": "^2.2.2",
|
|
55
|
-
"eslint": "^8.
|
|
55
|
+
"eslint": "^8.36.0",
|
|
56
56
|
"mockjs": "^1.1.0",
|
|
57
|
-
"prettier": "^2.8.
|
|
58
|
-
"tsup": "^6.
|
|
59
|
-
"typescript": "^
|
|
60
|
-
"vite": "^4.1
|
|
61
|
-
"vitepress": "1.0.0-alpha.
|
|
57
|
+
"prettier": "^2.8.6",
|
|
58
|
+
"tsup": "^6.7.0",
|
|
59
|
+
"typescript": "^5.0.2",
|
|
60
|
+
"vite": "^4.2.1",
|
|
61
|
+
"vitepress": "1.0.0-alpha.61",
|
|
62
62
|
"vue": "^3.2.47"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|