vite-plugin-mock-dev-server 0.3.20 → 0.4.0
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 +8 -2
- package/README.zh-CN.md +8 -2
- package/dist/index.cjs +37 -10
- package/dist/index.d.ts +4 -0
- package/dist/index.js +27 -7
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -263,14 +263,14 @@ export default defineMock({
|
|
|
263
263
|
* configurations and determines which mock configuration
|
|
264
264
|
* is valid according to the validator.
|
|
265
265
|
*
|
|
266
|
-
* @type { headers?: object; body?: object; query?: object; params?: object }
|
|
266
|
+
* @type { headers?: object; body?: object; query?: object; params?: object; refererQuery?: object }
|
|
267
267
|
*
|
|
268
268
|
* If the validator incoming is an object,
|
|
269
269
|
* then the validation method is the comparison of the
|
|
270
270
|
* strict request of interface, headers/body/query/params
|
|
271
271
|
* each `key-value` congruent, congruent check through
|
|
272
272
|
*
|
|
273
|
-
* @type ({ headers: object; body: object; query: object; params: object }) => boolean
|
|
273
|
+
* @type ({ headers: object; body: object; query: object; params: object; refererQuery: object }) => boolean
|
|
274
274
|
* If the validator is passed a function,
|
|
275
275
|
* it takes the requested interface-related data as an input,
|
|
276
276
|
* gives it to the consumer for custom validation,
|
|
@@ -282,6 +282,12 @@ export default defineMock({
|
|
|
282
282
|
body: {},
|
|
283
283
|
query: {},
|
|
284
284
|
params: {},
|
|
285
|
+
/**
|
|
286
|
+
* refererQuery validates the query in the url of the page from which the request originated,
|
|
287
|
+
* which makes it possible to modify parameters directly in the browser address bar to get
|
|
288
|
+
* different mock data
|
|
289
|
+
*/
|
|
290
|
+
refererQuery: {}
|
|
285
291
|
},
|
|
286
292
|
/**
|
|
287
293
|
*
|
package/README.zh-CN.md
CHANGED
|
@@ -262,13 +262,13 @@ export default defineMock({
|
|
|
262
262
|
* 验证器可以很好的解决这一类问题,将同个 url 分为多个 mock配置,
|
|
263
263
|
* 根据 验证器来判断哪个mock配置生效。
|
|
264
264
|
*
|
|
265
|
-
* @type { headers?: object; body?: object; query?: object; params?: object }
|
|
265
|
+
* @type { headers?: object; body?: object; query?: object; params?: object; refererQuery?: object }
|
|
266
266
|
*
|
|
267
267
|
* 如果 validator 传入的是一个对象,那么验证方式是严格比较 请求的接口
|
|
268
268
|
* 中,headers/body/query/params 的各个`key`的`value`是否全等,
|
|
269
269
|
* 全等则校验通过
|
|
270
270
|
*
|
|
271
|
-
* @type ({ headers: object; body: object; query: object; params: object }) => boolean
|
|
271
|
+
* @type ({ headers: object; body: object; query: object; params: object; refererQuery: object }) => boolean
|
|
272
272
|
* 如果 validator 传入的是一个函数,那么会讲 请求的接口相关数据作为入参,提供给使用者进行自定义校验,并返回一个 boolean
|
|
273
273
|
*
|
|
274
274
|
*/
|
|
@@ -277,6 +277,12 @@ export default defineMock({
|
|
|
277
277
|
body: {},
|
|
278
278
|
query: {},
|
|
279
279
|
params: {},
|
|
280
|
+
/**
|
|
281
|
+
* refererQuery validates the query in the url of the page from which the request originated,
|
|
282
|
+
* which makes it possible to modify parameters directly in the browser address bar to get
|
|
283
|
+
* different mock data
|
|
284
|
+
*/
|
|
285
|
+
refererQuery: {}
|
|
280
286
|
},
|
|
281
287
|
/**
|
|
282
288
|
*
|
package/dist/index.cjs
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -33,6 +37,10 @@ __export(src_exports, {
|
|
|
33
37
|
});
|
|
34
38
|
module.exports = __toCommonJS(src_exports);
|
|
35
39
|
|
|
40
|
+
// node_modules/.pnpm/tsup@6.6.3_typescript@4.9.5/node_modules/tsup/assets/cjs_shims.js
|
|
41
|
+
var getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
42
|
+
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
43
|
+
|
|
36
44
|
// src/build.ts
|
|
37
45
|
var import_node_fs2 = __toESM(require("fs"), 1);
|
|
38
46
|
var import_promises2 = __toESM(require("fs/promises"), 1);
|
|
@@ -44,7 +52,7 @@ var import_vite = require("vite");
|
|
|
44
52
|
|
|
45
53
|
// package.json
|
|
46
54
|
var name = "vite-plugin-mock-dev-server";
|
|
47
|
-
var version = "0.
|
|
55
|
+
var version = "0.4.0";
|
|
48
56
|
|
|
49
57
|
// src/esbuildPlugin.ts
|
|
50
58
|
var import_promises = __toESM(require("fs/promises"), 1);
|
|
@@ -97,8 +105,8 @@ var isFunction = (val) => typeof val === "function";
|
|
|
97
105
|
function sleep(timeout) {
|
|
98
106
|
return new Promise((resolve) => setTimeout(resolve, timeout));
|
|
99
107
|
}
|
|
100
|
-
function getDirname(
|
|
101
|
-
return import_node_path2.default.dirname((0, import_node_url.fileURLToPath)(
|
|
108
|
+
function getDirname(importMetaUrl2) {
|
|
109
|
+
return import_node_path2.default.dirname((0, import_node_url.fileURLToPath)(importMetaUrl2));
|
|
102
110
|
}
|
|
103
111
|
var debug = (0, import_debug.default)("vite:plugin-mock-dev-server");
|
|
104
112
|
var ensureArray = (thing) => {
|
|
@@ -123,6 +131,13 @@ function lookupFile(dir, formats, options) {
|
|
|
123
131
|
return lookupFile(parentDir, formats, options);
|
|
124
132
|
}
|
|
125
133
|
}
|
|
134
|
+
var ensureProxies = (serverProxy = {}) => {
|
|
135
|
+
const proxies = Object.keys(serverProxy).map((key) => {
|
|
136
|
+
const value = serverProxy[key];
|
|
137
|
+
return typeof value === "string" ? key : value.ws === true ? "" : key;
|
|
138
|
+
}).filter(Boolean);
|
|
139
|
+
return proxies;
|
|
140
|
+
};
|
|
126
141
|
|
|
127
142
|
// src/build.ts
|
|
128
143
|
async function generateMockServer(ctx, config, options) {
|
|
@@ -135,7 +150,7 @@ async function generateMockServer(ctx, config, options) {
|
|
|
135
150
|
define[key] = typeof val === "string" ? val : JSON.stringify(val);
|
|
136
151
|
}
|
|
137
152
|
}
|
|
138
|
-
const proxies =
|
|
153
|
+
const proxies = ensureProxies(config.server.proxy || {});
|
|
139
154
|
const prefix = ensureArray(options.prefix);
|
|
140
155
|
let pkg = {};
|
|
141
156
|
try {
|
|
@@ -227,7 +242,7 @@ import mockData from './mock-data.js'
|
|
|
227
242
|
const app = connect()
|
|
228
243
|
app.use(baseMiddleware({ mockData }, {
|
|
229
244
|
formidableOptions: { multiples: true },
|
|
230
|
-
proxies: ${JSON.stringify(proxies)}
|
|
245
|
+
proxies: ${JSON.stringify(proxies)}
|
|
231
246
|
}))
|
|
232
247
|
app.listen(${port})
|
|
233
248
|
console.log('listen: http://localhost:${port}')
|
|
@@ -302,6 +317,7 @@ async function buildMockEntry(inputFile, define) {
|
|
|
302
317
|
|
|
303
318
|
// src/baseMiddleware.ts
|
|
304
319
|
var import_node_url2 = require("url");
|
|
320
|
+
var import_http_status = __toESM(require("http-status"), 1);
|
|
305
321
|
var import_path_to_regexp = require("path-to-regexp");
|
|
306
322
|
|
|
307
323
|
// src/parseReqBody.ts
|
|
@@ -345,7 +361,7 @@ async function parseMultipart(req, options) {
|
|
|
345
361
|
|
|
346
362
|
// src/validator.ts
|
|
347
363
|
function validate(request, validator) {
|
|
348
|
-
return equalObj(request.headers, validator.headers) && equalObj(request.body, validator.body) && equalObj(request.params, validator.params) && equalObj(request.query, validator.query);
|
|
364
|
+
return equalObj(request.headers, validator.headers) && equalObj(request.body, validator.body) && equalObj(request.params, validator.params) && equalObj(request.query, validator.query) && equalObj(request.refererQuery, validator.refererQuery);
|
|
349
365
|
}
|
|
350
366
|
function equalObj(left, right) {
|
|
351
367
|
if (!right)
|
|
@@ -362,6 +378,7 @@ function baseMiddleware(mockLoader, { formidableOptions = {}, proxies }) {
|
|
|
362
378
|
return async function(req, res, next) {
|
|
363
379
|
const method = req.method.toUpperCase();
|
|
364
380
|
const { query, pathname } = (0, import_node_url2.parse)(req.url, true);
|
|
381
|
+
const { query: refererQuery } = (0, import_node_url2.parse)(req.headers.referer || "", true);
|
|
365
382
|
if (!pathname || proxies.length === 0 || !proxies.some((context) => doesProxyContextMatchUrl(context, req.url))) {
|
|
366
383
|
return next();
|
|
367
384
|
}
|
|
@@ -388,6 +405,7 @@ function baseMiddleware(mockLoader, { formidableOptions = {}, proxies }) {
|
|
|
388
405
|
const params2 = urlMatch2.params || {};
|
|
389
406
|
const request = {
|
|
390
407
|
query,
|
|
408
|
+
refererQuery,
|
|
391
409
|
params: params2,
|
|
392
410
|
body: reqBody,
|
|
393
411
|
headers: req.headers
|
|
@@ -407,19 +425,21 @@ function baseMiddleware(mockLoader, { formidableOptions = {}, proxies }) {
|
|
|
407
425
|
await sleep(currentMock.delay);
|
|
408
426
|
}
|
|
409
427
|
res.statusCode = currentMock.status || 200;
|
|
410
|
-
res.statusMessage = currentMock.statusText ||
|
|
428
|
+
res.statusMessage = currentMock.statusText || getHTTPStatusText(res.statusCode);
|
|
411
429
|
const urlMatch = (0, import_path_to_regexp.match)(currentMock.url, { decode: decodeURIComponent })(
|
|
412
430
|
pathname
|
|
413
431
|
) || { params: {} };
|
|
414
432
|
const params = urlMatch.params || {};
|
|
415
433
|
req.body = reqBody;
|
|
416
434
|
req.query = query;
|
|
435
|
+
req.refererQuery = refererQuery;
|
|
417
436
|
req.params = params;
|
|
418
437
|
res.setHeader("Content-Type", "application/json");
|
|
419
438
|
res.setHeader("X-Mock", "generate by vite:mock-dev-server");
|
|
420
439
|
if (currentMock.headers) {
|
|
421
440
|
const headers = isFunction(currentMock.headers) ? await currentMock.headers({
|
|
422
441
|
query,
|
|
442
|
+
refererQuery,
|
|
423
443
|
body: reqBody,
|
|
424
444
|
params,
|
|
425
445
|
headers: req.headers
|
|
@@ -433,6 +453,7 @@ function baseMiddleware(mockLoader, { formidableOptions = {}, proxies }) {
|
|
|
433
453
|
if (isFunction(currentMock.body)) {
|
|
434
454
|
body = await currentMock.body({
|
|
435
455
|
query,
|
|
456
|
+
refererQuery,
|
|
436
457
|
body: reqBody,
|
|
437
458
|
params,
|
|
438
459
|
headers: req.headers
|
|
@@ -457,6 +478,9 @@ function baseMiddleware(mockLoader, { formidableOptions = {}, proxies }) {
|
|
|
457
478
|
function doesProxyContextMatchUrl(context, url) {
|
|
458
479
|
return context.startsWith("^") && new RegExp(context).test(url) || url.startsWith(context);
|
|
459
480
|
}
|
|
481
|
+
function getHTTPStatusText(status) {
|
|
482
|
+
return import_http_status.default[status] || "Unknown";
|
|
483
|
+
}
|
|
460
484
|
|
|
461
485
|
// src/MockLoader.ts
|
|
462
486
|
var import_node_events = __toESM(require("events"), 1);
|
|
@@ -469,8 +493,7 @@ var import_esbuild2 = require("esbuild");
|
|
|
469
493
|
var import_fast_glob2 = __toESM(require("fast-glob"), 1);
|
|
470
494
|
var import_json52 = __toESM(require("json5"), 1);
|
|
471
495
|
var import_vite2 = require("vite");
|
|
472
|
-
var
|
|
473
|
-
var _dirname = typeof __dirname !== "undefined" ? __dirname : getDirname(import_meta.url);
|
|
496
|
+
var _dirname = getDirname(importMetaUrl);
|
|
474
497
|
var _require = (0, import_node_module.createRequire)(_dirname);
|
|
475
498
|
var _MockLoader = class extends import_node_events.default {
|
|
476
499
|
constructor(options) {
|
|
@@ -539,6 +562,10 @@ var _MockLoader = class extends import_node_events.default {
|
|
|
539
562
|
});
|
|
540
563
|
this.mockWatcher = watcher;
|
|
541
564
|
}
|
|
565
|
+
/**
|
|
566
|
+
* 监听 mock文件依赖的本地文件变动,
|
|
567
|
+
* mock依赖文件更新,mock文件也一并更新
|
|
568
|
+
*/
|
|
542
569
|
watchDeps() {
|
|
543
570
|
const oldDeps = [];
|
|
544
571
|
this.depsWatcher = import_chokidar.default.watch([], {
|
|
@@ -716,7 +743,7 @@ async function mockServerMiddleware(httpServer, config, options) {
|
|
|
716
743
|
});
|
|
717
744
|
await loader.load();
|
|
718
745
|
httpServer == null ? void 0 : httpServer.on("close", () => loader.close());
|
|
719
|
-
const proxies =
|
|
746
|
+
const proxies = ensureProxies(config.server.proxy || {});
|
|
720
747
|
const prefix = ensureArray(options.prefix);
|
|
721
748
|
return baseMiddleware(loader, {
|
|
722
749
|
formidableOptions: options.formidableOptions,
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { createFilter } from "vite";
|
|
|
9
9
|
|
|
10
10
|
// package.json
|
|
11
11
|
var name = "vite-plugin-mock-dev-server";
|
|
12
|
-
var version = "0.
|
|
12
|
+
var version = "0.4.0";
|
|
13
13
|
|
|
14
14
|
// src/esbuildPlugin.ts
|
|
15
15
|
import fsp from "fs/promises";
|
|
@@ -88,6 +88,13 @@ function lookupFile(dir, formats, options) {
|
|
|
88
88
|
return lookupFile(parentDir, formats, options);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
+
var ensureProxies = (serverProxy = {}) => {
|
|
92
|
+
const proxies = Object.keys(serverProxy).map((key) => {
|
|
93
|
+
const value = serverProxy[key];
|
|
94
|
+
return typeof value === "string" ? key : value.ws === true ? "" : key;
|
|
95
|
+
}).filter(Boolean);
|
|
96
|
+
return proxies;
|
|
97
|
+
};
|
|
91
98
|
|
|
92
99
|
// src/build.ts
|
|
93
100
|
async function generateMockServer(ctx, config, options) {
|
|
@@ -100,7 +107,7 @@ async function generateMockServer(ctx, config, options) {
|
|
|
100
107
|
define[key] = typeof val === "string" ? val : JSON.stringify(val);
|
|
101
108
|
}
|
|
102
109
|
}
|
|
103
|
-
const proxies =
|
|
110
|
+
const proxies = ensureProxies(config.server.proxy || {});
|
|
104
111
|
const prefix = ensureArray(options.prefix);
|
|
105
112
|
let pkg = {};
|
|
106
113
|
try {
|
|
@@ -192,7 +199,7 @@ import mockData from './mock-data.js'
|
|
|
192
199
|
const app = connect()
|
|
193
200
|
app.use(baseMiddleware({ mockData }, {
|
|
194
201
|
formidableOptions: { multiples: true },
|
|
195
|
-
proxies: ${JSON.stringify(proxies)}
|
|
202
|
+
proxies: ${JSON.stringify(proxies)}
|
|
196
203
|
}))
|
|
197
204
|
app.listen(${port})
|
|
198
205
|
console.log('listen: http://localhost:${port}')
|
|
@@ -267,6 +274,7 @@ async function buildMockEntry(inputFile, define) {
|
|
|
267
274
|
|
|
268
275
|
// src/baseMiddleware.ts
|
|
269
276
|
import { parse as urlParse } from "url";
|
|
277
|
+
import HTTP_STATUS from "http-status";
|
|
270
278
|
import { match, pathToRegexp } from "path-to-regexp";
|
|
271
279
|
|
|
272
280
|
// src/parseReqBody.ts
|
|
@@ -310,7 +318,7 @@ async function parseMultipart(req, options) {
|
|
|
310
318
|
|
|
311
319
|
// src/validator.ts
|
|
312
320
|
function validate(request, validator) {
|
|
313
|
-
return equalObj(request.headers, validator.headers) && equalObj(request.body, validator.body) && equalObj(request.params, validator.params) && equalObj(request.query, validator.query);
|
|
321
|
+
return equalObj(request.headers, validator.headers) && equalObj(request.body, validator.body) && equalObj(request.params, validator.params) && equalObj(request.query, validator.query) && equalObj(request.refererQuery, validator.refererQuery);
|
|
314
322
|
}
|
|
315
323
|
function equalObj(left, right) {
|
|
316
324
|
if (!right)
|
|
@@ -327,6 +335,7 @@ function baseMiddleware(mockLoader, { formidableOptions = {}, proxies }) {
|
|
|
327
335
|
return async function(req, res, next) {
|
|
328
336
|
const method = req.method.toUpperCase();
|
|
329
337
|
const { query, pathname } = urlParse(req.url, true);
|
|
338
|
+
const { query: refererQuery } = urlParse(req.headers.referer || "", true);
|
|
330
339
|
if (!pathname || proxies.length === 0 || !proxies.some((context) => doesProxyContextMatchUrl(context, req.url))) {
|
|
331
340
|
return next();
|
|
332
341
|
}
|
|
@@ -353,6 +362,7 @@ function baseMiddleware(mockLoader, { formidableOptions = {}, proxies }) {
|
|
|
353
362
|
const params2 = urlMatch2.params || {};
|
|
354
363
|
const request = {
|
|
355
364
|
query,
|
|
365
|
+
refererQuery,
|
|
356
366
|
params: params2,
|
|
357
367
|
body: reqBody,
|
|
358
368
|
headers: req.headers
|
|
@@ -372,19 +382,21 @@ function baseMiddleware(mockLoader, { formidableOptions = {}, proxies }) {
|
|
|
372
382
|
await sleep(currentMock.delay);
|
|
373
383
|
}
|
|
374
384
|
res.statusCode = currentMock.status || 200;
|
|
375
|
-
res.statusMessage = currentMock.statusText ||
|
|
385
|
+
res.statusMessage = currentMock.statusText || getHTTPStatusText(res.statusCode);
|
|
376
386
|
const urlMatch = match(currentMock.url, { decode: decodeURIComponent })(
|
|
377
387
|
pathname
|
|
378
388
|
) || { params: {} };
|
|
379
389
|
const params = urlMatch.params || {};
|
|
380
390
|
req.body = reqBody;
|
|
381
391
|
req.query = query;
|
|
392
|
+
req.refererQuery = refererQuery;
|
|
382
393
|
req.params = params;
|
|
383
394
|
res.setHeader("Content-Type", "application/json");
|
|
384
395
|
res.setHeader("X-Mock", "generate by vite:mock-dev-server");
|
|
385
396
|
if (currentMock.headers) {
|
|
386
397
|
const headers = isFunction(currentMock.headers) ? await currentMock.headers({
|
|
387
398
|
query,
|
|
399
|
+
refererQuery,
|
|
388
400
|
body: reqBody,
|
|
389
401
|
params,
|
|
390
402
|
headers: req.headers
|
|
@@ -398,6 +410,7 @@ function baseMiddleware(mockLoader, { formidableOptions = {}, proxies }) {
|
|
|
398
410
|
if (isFunction(currentMock.body)) {
|
|
399
411
|
body = await currentMock.body({
|
|
400
412
|
query,
|
|
413
|
+
refererQuery,
|
|
401
414
|
body: reqBody,
|
|
402
415
|
params,
|
|
403
416
|
headers: req.headers
|
|
@@ -422,6 +435,9 @@ function baseMiddleware(mockLoader, { formidableOptions = {}, proxies }) {
|
|
|
422
435
|
function doesProxyContextMatchUrl(context, url) {
|
|
423
436
|
return context.startsWith("^") && new RegExp(context).test(url) || url.startsWith(context);
|
|
424
437
|
}
|
|
438
|
+
function getHTTPStatusText(status) {
|
|
439
|
+
return HTTP_STATUS[status] || "Unknown";
|
|
440
|
+
}
|
|
425
441
|
|
|
426
442
|
// src/MockLoader.ts
|
|
427
443
|
import EventEmitter from "events";
|
|
@@ -434,7 +450,7 @@ import { build as build2 } from "esbuild";
|
|
|
434
450
|
import fastGlob from "fast-glob";
|
|
435
451
|
import JSON52 from "json5";
|
|
436
452
|
import { createFilter as createFilter2 } from "vite";
|
|
437
|
-
var _dirname =
|
|
453
|
+
var _dirname = getDirname(import.meta.url);
|
|
438
454
|
var _require = createRequire(_dirname);
|
|
439
455
|
var _MockLoader = class extends EventEmitter {
|
|
440
456
|
constructor(options) {
|
|
@@ -503,6 +519,10 @@ var _MockLoader = class extends EventEmitter {
|
|
|
503
519
|
});
|
|
504
520
|
this.mockWatcher = watcher;
|
|
505
521
|
}
|
|
522
|
+
/**
|
|
523
|
+
* 监听 mock文件依赖的本地文件变动,
|
|
524
|
+
* mock依赖文件更新,mock文件也一并更新
|
|
525
|
+
*/
|
|
506
526
|
watchDeps() {
|
|
507
527
|
const oldDeps = [];
|
|
508
528
|
this.depsWatcher = chokidar.watch([], {
|
|
@@ -680,7 +700,7 @@ async function mockServerMiddleware(httpServer, config, options) {
|
|
|
680
700
|
});
|
|
681
701
|
await loader.load();
|
|
682
702
|
httpServer == null ? void 0 : httpServer.on("close", () => loader.close());
|
|
683
|
-
const proxies =
|
|
703
|
+
const proxies = ensureProxies(config.server.proxy || {});
|
|
684
704
|
const prefix = ensureArray(options.prefix);
|
|
685
705
|
return baseMiddleware(loader, {
|
|
686
706
|
formidableOptions: options.formidableOptions,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-mock-dev-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"vite",
|
|
6
6
|
"plugin",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"esbuild": "^0.17.6",
|
|
37
37
|
"fast-glob": "^3.2.12",
|
|
38
38
|
"formidable": "^2.1.1",
|
|
39
|
+
"http-status": "^1.6.2",
|
|
39
40
|
"is-core-module": "^2.11.0",
|
|
40
41
|
"json5": "^2.2.3",
|
|
41
42
|
"path-to-regexp": "^6.2.1"
|
|
@@ -53,7 +54,7 @@
|
|
|
53
54
|
"eslint": "^8.33.0",
|
|
54
55
|
"mockjs": "^1.1.0",
|
|
55
56
|
"prettier": "^2.8.3",
|
|
56
|
-
"tsup": "^6.
|
|
57
|
+
"tsup": "^6.6.3",
|
|
57
58
|
"typescript": "^4.9.5",
|
|
58
59
|
"vite": "^4.1.1",
|
|
59
60
|
"vitepress": "1.0.0-alpha.45",
|
|
@@ -70,6 +71,7 @@
|
|
|
70
71
|
"entry": [
|
|
71
72
|
"src/index.ts"
|
|
72
73
|
],
|
|
74
|
+
"shims": true,
|
|
73
75
|
"sourcemap": false,
|
|
74
76
|
"dts": true,
|
|
75
77
|
"splitting": false,
|