rspack-plugin-mock 1.2.0 → 1.3.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 +10 -2
- package/README.zh-CN.md +13 -5
- package/dist/{helper.d.cts → helper.d.mts} +60 -44
- package/dist/helper.mjs +4 -0
- package/dist/index.d.mts +13 -0
- package/dist/index.mjs +1 -0
- package/dist/json5-loader.cjs +1 -32
- package/dist/options-BUfaThYe.mjs +43 -0
- package/dist/rsbuild.d.mts +7 -0
- package/dist/rsbuild.mjs +1 -0
- package/dist/{mockWebsocket-DkVHpZCx.d.cts → server-4ETytB7L.d.mts} +44 -40
- package/dist/server.d.mts +3 -0
- package/dist/server.mjs +1 -0
- package/dist/{types-6lajtJPx.d.cts → types-Bt_OTa7I.d.mts} +139 -10
- package/dist/ws-BM06pHhL.mjs +1 -0
- package/package.json +40 -51
- package/dist/chunk-CUT6urMc.cjs +0 -30
- package/dist/helper.cjs +0 -140
- package/dist/helper.d.ts +0 -110
- package/dist/helper.js +0 -136
- package/dist/index.cjs +0 -86
- package/dist/index.d.cts +0 -13
- package/dist/index.d.ts +0 -13
- package/dist/index.js +0 -80
- package/dist/logger-C0V8Cvvd.cjs +0 -800
- package/dist/logger-C48_LmdS.js +0 -710
- package/dist/mockWebsocket-qLVAe-RI.d.ts +0 -85
- package/dist/resolvePluginOptions-Da5uqlBx.cjs +0 -506
- package/dist/resolvePluginOptions-DlkIkykz.js +0 -476
- package/dist/rsbuild.cjs +0 -176
- package/dist/rsbuild.d.cts +0 -7
- package/dist/rsbuild.d.ts +0 -7
- package/dist/rsbuild.js +0 -175
- package/dist/server.cjs +0 -9
- package/dist/server.d.cts +0 -27
- package/dist/server.d.ts +0 -27
- package/dist/server.js +0 -3
- package/dist/types-DPzh7nJq.d.ts +0 -572
package/dist/helper.js
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { deepClone, deepEqual, isArray, isFunction } from "@pengzhanbo/utils";
|
|
2
|
-
import { Transform } from "node:stream";
|
|
3
|
-
|
|
4
|
-
//#region src/core/defineMock.ts
|
|
5
|
-
function defineMock(config) {
|
|
6
|
-
return config;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Return a custom defineMock function to support preprocessing of mock config.
|
|
10
|
-
*
|
|
11
|
-
* 返回一个自定义的 defineMock 函数,用于支持对 mock config 的预处理。
|
|
12
|
-
* @param transformer preprocessing function
|
|
13
|
-
* @example
|
|
14
|
-
* ```ts
|
|
15
|
-
* const definePostMock = createDefineMock((mock) => {
|
|
16
|
-
* mock.url = '/api/post/' + mock.url
|
|
17
|
-
* })
|
|
18
|
-
* export default definePostMock({
|
|
19
|
-
* url: 'list',
|
|
20
|
-
* body: [{ title: '1' }, { title: '2' }],
|
|
21
|
-
* })
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
function createDefineMock(transformer) {
|
|
25
|
-
const define = (config) => {
|
|
26
|
-
if (isArray(config)) config = config.map((item) => transformer(item) || item);
|
|
27
|
-
else config = transformer(config) || config;
|
|
28
|
-
return config;
|
|
29
|
-
};
|
|
30
|
-
return define;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
//#endregion
|
|
34
|
-
//#region src/core/defineMockData.ts
|
|
35
|
-
const mockDataCache = /* @__PURE__ */ new Map();
|
|
36
|
-
const responseCache = /* @__PURE__ */ new WeakMap();
|
|
37
|
-
const staleInterval = 70;
|
|
38
|
-
var CacheImpl = class {
|
|
39
|
-
value;
|
|
40
|
-
#initialValue;
|
|
41
|
-
#lastUpdate;
|
|
42
|
-
constructor(value) {
|
|
43
|
-
this.value = value;
|
|
44
|
-
this.#initialValue = deepClone(value);
|
|
45
|
-
this.#lastUpdate = Date.now();
|
|
46
|
-
}
|
|
47
|
-
hotUpdate(value) {
|
|
48
|
-
if (Date.now() - this.#lastUpdate < staleInterval) return;
|
|
49
|
-
if (!deepEqual(value, this.#initialValue)) {
|
|
50
|
-
this.value = value;
|
|
51
|
-
this.#initialValue = deepClone(value);
|
|
52
|
-
this.#lastUpdate = Date.now();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
function defineMockData(key, initialData) {
|
|
57
|
-
if (!mockDataCache.has(key)) mockDataCache.set(key, new CacheImpl(initialData));
|
|
58
|
-
const cache = mockDataCache.get(key);
|
|
59
|
-
cache.hotUpdate(initialData);
|
|
60
|
-
if (responseCache.has(cache)) return responseCache.get(cache);
|
|
61
|
-
const res = [() => cache.value, (val) => {
|
|
62
|
-
if (isFunction(val)) val = val(cache.value) ?? cache.value;
|
|
63
|
-
cache.value = val;
|
|
64
|
-
}];
|
|
65
|
-
Object.defineProperty(res, "value", {
|
|
66
|
-
get() {
|
|
67
|
-
return cache.value;
|
|
68
|
-
},
|
|
69
|
-
set(val) {
|
|
70
|
-
cache.value = val;
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
responseCache.set(cache, res);
|
|
74
|
-
return res;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
//#endregion
|
|
78
|
-
//#region src/core/sse.ts
|
|
79
|
-
/**
|
|
80
|
-
* Transforms "messages" to W3C event stream content.
|
|
81
|
-
* See https://html.spec.whatwg.org/multipage/server-sent-events.html
|
|
82
|
-
* A message is an object with one or more of the following properties:
|
|
83
|
-
* - data (String or object, which gets turned into JSON)
|
|
84
|
-
* - event
|
|
85
|
-
* - id
|
|
86
|
-
* - retry
|
|
87
|
-
* - comment
|
|
88
|
-
*
|
|
89
|
-
* If constructed with a HTTP Request, it will optimise the socket for streaming.
|
|
90
|
-
* If this stream is piped to an HTTP Response, it will set appropriate headers.
|
|
91
|
-
*/
|
|
92
|
-
var SSEStream = class extends Transform {
|
|
93
|
-
constructor(req) {
|
|
94
|
-
super({ objectMode: true });
|
|
95
|
-
req.socket.setKeepAlive(true);
|
|
96
|
-
req.socket.setNoDelay(true);
|
|
97
|
-
req.socket.setTimeout(0);
|
|
98
|
-
}
|
|
99
|
-
pipe(destination, options) {
|
|
100
|
-
if (destination.writeHead) {
|
|
101
|
-
destination.writeHead(200, {
|
|
102
|
-
"Content-Type": "text/event-stream; charset=utf-8",
|
|
103
|
-
"Transfer-Encoding": "identity",
|
|
104
|
-
"Cache-Control": "no-cache",
|
|
105
|
-
"Connection": "keep-alive"
|
|
106
|
-
});
|
|
107
|
-
destination.flushHeaders?.();
|
|
108
|
-
}
|
|
109
|
-
destination.write(":ok\n\n");
|
|
110
|
-
return super.pipe(destination, options);
|
|
111
|
-
}
|
|
112
|
-
_transform(message, encoding, callback) {
|
|
113
|
-
if (message.comment) this.push(`: ${message.comment}\n`);
|
|
114
|
-
if (message.event) this.push(`event: ${message.event}\n`);
|
|
115
|
-
if (message.id) this.push(`id: ${message.id}\n`);
|
|
116
|
-
if (message.retry) this.push(`retry: ${message.retry}\n`);
|
|
117
|
-
if (message.data) this.push(dataString(message.data));
|
|
118
|
-
this.push("\n");
|
|
119
|
-
callback();
|
|
120
|
-
}
|
|
121
|
-
write(message, ...args) {
|
|
122
|
-
return super.write(message, ...args);
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
function dataString(data) {
|
|
126
|
-
if (typeof data === "object") return dataString(JSON.stringify(data));
|
|
127
|
-
return data.split(/\r\n|\r|\n/).map((line) => `data: ${line}\n`).join("");
|
|
128
|
-
}
|
|
129
|
-
function createSSEStream(req, res) {
|
|
130
|
-
const sse = new SSEStream(req);
|
|
131
|
-
sse.pipe(res);
|
|
132
|
-
return sse;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
//#endregion
|
|
136
|
-
export { createDefineMock, createSSEStream, defineMock, defineMockData };
|
package/dist/index.cjs
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
-
const require_logger = require('./logger-C0V8Cvvd.cjs');
|
|
3
|
-
const require_resolvePluginOptions = require('./resolvePluginOptions-Da5uqlBx.cjs');
|
|
4
|
-
const __pengzhanbo_utils = require_chunk.__toESM(require("@pengzhanbo/utils"));
|
|
5
|
-
const node_path = require_chunk.__toESM(require("node:path"));
|
|
6
|
-
const node_process = require_chunk.__toESM(require("node:process"));
|
|
7
|
-
const __rspack_core = require_chunk.__toESM(require("@rspack/core"));
|
|
8
|
-
|
|
9
|
-
//#region src/rspack.ts
|
|
10
|
-
const PLUGIN_NAME = "rspack-plugin-mock";
|
|
11
|
-
var MockServerPlugin = class {
|
|
12
|
-
constructor(options = {}) {
|
|
13
|
-
this.options = options;
|
|
14
|
-
}
|
|
15
|
-
apply(compiler) {
|
|
16
|
-
const compilerOptions = compiler.options;
|
|
17
|
-
const options = resolvePluginOptions$1(compiler, this.options);
|
|
18
|
-
if (node_process.default.env.NODE_ENV !== "production") {
|
|
19
|
-
const mockCompiler = require_resolvePluginOptions.createMockCompiler(options);
|
|
20
|
-
const mockMiddleware = require_resolvePluginOptions.createMockMiddleware(mockCompiler, options);
|
|
21
|
-
const setupMiddlewares = compilerOptions.devServer?.setupMiddlewares;
|
|
22
|
-
const waitServerForMockWebSocket = require_logger.waitingFor((server) => {
|
|
23
|
-
require_logger.mockWebSocket(mockCompiler, server, options);
|
|
24
|
-
});
|
|
25
|
-
compilerOptions.devServer = {
|
|
26
|
-
...compilerOptions.devServer,
|
|
27
|
-
setupMiddlewares: (middlewares, devServer) => {
|
|
28
|
-
middlewares = setupMiddlewares?.(middlewares, devServer) || middlewares;
|
|
29
|
-
const reload = () => {
|
|
30
|
-
if (devServer.webSocketServer?.clients) devServer.sendMessage(devServer.webSocketServer.clients, "static-changed");
|
|
31
|
-
};
|
|
32
|
-
middlewares = mockMiddleware(middlewares, reload) || middlewares;
|
|
33
|
-
/**
|
|
34
|
-
* 在 @rspack/dev-server -> webpack-dev-server 中, setupMiddlewares 优先于 createServer
|
|
35
|
-
* 执行,需要等待 server 启动后再注入 mock websocket
|
|
36
|
-
*/
|
|
37
|
-
waitServerForMockWebSocket(() => devServer.server);
|
|
38
|
-
return middlewares;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
const wsPrefix = (0, __pengzhanbo_utils.toArray)(options.wsPrefix);
|
|
42
|
-
if (compilerOptions.devServer?.proxy?.length) {
|
|
43
|
-
const proxy = compilerOptions.devServer.proxy;
|
|
44
|
-
compilerOptions.devServer.proxy = proxy.filter((item) => {
|
|
45
|
-
if (typeof item !== "function" && item.ws === true && wsPrefix.length) return !(0, __pengzhanbo_utils.toArray)(item.context).filter(__pengzhanbo_utils.isString).some((context) => wsPrefix.includes(context));
|
|
46
|
-
return true;
|
|
47
|
-
}).map((item) => {
|
|
48
|
-
if (typeof item !== "function" && !item.ws) {
|
|
49
|
-
const onProxyReq = item.onProxyReq;
|
|
50
|
-
item.onProxyReq = (proxyReq, req, ...args) => {
|
|
51
|
-
onProxyReq?.(proxyReq, req, ...args);
|
|
52
|
-
require_logger.rewriteRequest(proxyReq, req);
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
return item;
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
compiler.hooks.watchRun.tap(PLUGIN_NAME, () => mockCompiler.run());
|
|
59
|
-
compiler.hooks.watchClose.tap(PLUGIN_NAME, () => mockCompiler.close());
|
|
60
|
-
} else if (options.build !== false) compiler.hooks.afterEmit.tap(PLUGIN_NAME, () => require_resolvePluginOptions.buildMockServer(options, compilerOptions.output.path || node_path.default.resolve(node_process.default.cwd(), "dist")));
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
function resolvePluginOptions$1(compiler, options = {}) {
|
|
64
|
-
const compilerOptions = compiler.options;
|
|
65
|
-
const alias = compilerOptions.resolve?.alias || {};
|
|
66
|
-
const context = compilerOptions.context;
|
|
67
|
-
const definePluginInstance = compilerOptions.plugins?.find((plugin) => plugin instanceof __rspack_core.default.DefinePlugin);
|
|
68
|
-
const proxies = (compilerOptions.devServer?.proxy || []).flatMap((item) => {
|
|
69
|
-
if (typeof item !== "function" && item.context && !item.ws) return item.context;
|
|
70
|
-
return [];
|
|
71
|
-
});
|
|
72
|
-
return require_resolvePluginOptions.resolvePluginOptions(options, {
|
|
73
|
-
alias,
|
|
74
|
-
context,
|
|
75
|
-
plugins: (0, __pengzhanbo_utils.toArray)(definePluginInstance),
|
|
76
|
-
proxies
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
//#endregion
|
|
81
|
-
exports.MockCompiler = require_resolvePluginOptions.MockCompiler;
|
|
82
|
-
exports.MockServerPlugin = MockServerPlugin;
|
|
83
|
-
exports.createMockCompiler = require_resolvePluginOptions.createMockCompiler;
|
|
84
|
-
exports.createMockMiddleware = require_resolvePluginOptions.createMockMiddleware;
|
|
85
|
-
exports.mockWebSocket = require_logger.mockWebSocket;
|
|
86
|
-
exports.resolvePluginOptions = resolvePluginOptions$1;
|
package/dist/index.d.cts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { BodyParserOptions, ExtraRequest, FormidableFile, LogLevel, LogType, Method, MockHttpItem, MockMatchPriority, MockMatchSpecialPriority, MockOptions, MockRequest, MockResponse, MockServerPluginOptions, MockWebsocketItem, ResponseBody, ServerBuildOption, WebSocketSetupContext } from "./types-6lajtJPx.cjs";
|
|
2
|
-
import { Middleware, MiddlewareOptions, MockCompiler, MockCompilerOptions, MockSocketOptions, ResolvePluginOptions, Server, createMockCompiler, createMockMiddleware, mockWebSocket } from "./mockWebsocket-DkVHpZCx.cjs";
|
|
3
|
-
import { Compiler, RspackPluginInstance } from "@rspack/core";
|
|
4
|
-
|
|
5
|
-
//#region src/rspack.d.ts
|
|
6
|
-
declare class MockServerPlugin implements RspackPluginInstance {
|
|
7
|
-
options: MockServerPluginOptions;
|
|
8
|
-
constructor(options?: MockServerPluginOptions);
|
|
9
|
-
apply(compiler: Compiler): void;
|
|
10
|
-
}
|
|
11
|
-
declare function resolvePluginOptions(compiler: Compiler, options?: MockServerPluginOptions): ResolvePluginOptions;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { BodyParserOptions, ExtraRequest, FormidableFile, LogLevel, LogType, Method, Middleware, MiddlewareOptions, MockCompiler, MockCompilerOptions, MockHttpItem, MockMatchPriority, MockMatchSpecialPriority, MockOptions, MockRequest, MockResponse, MockServerPlugin, MockServerPluginOptions, MockSocketOptions, MockWebsocketItem, ResponseBody, Server, ServerBuildOption, WebSocketSetupContext, createMockCompiler, createMockMiddleware, mockWebSocket, resolvePluginOptions };
|
package/dist/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { BodyParserOptions, ExtraRequest, FormidableFile, LogLevel, LogType, Method, MockHttpItem, MockMatchPriority, MockMatchSpecialPriority, MockOptions, MockRequest, MockResponse, MockServerPluginOptions, MockWebsocketItem, ResponseBody, ServerBuildOption, WebSocketSetupContext } from "./types-DPzh7nJq.js";
|
|
2
|
-
import { Middleware, MiddlewareOptions, MockCompiler, MockCompilerOptions, MockSocketOptions, ResolvePluginOptions, Server, createMockCompiler, createMockMiddleware, mockWebSocket } from "./mockWebsocket-qLVAe-RI.js";
|
|
3
|
-
import { Compiler, RspackPluginInstance } from "@rspack/core";
|
|
4
|
-
|
|
5
|
-
//#region src/rspack.d.ts
|
|
6
|
-
declare class MockServerPlugin implements RspackPluginInstance {
|
|
7
|
-
options: MockServerPluginOptions;
|
|
8
|
-
constructor(options?: MockServerPluginOptions);
|
|
9
|
-
apply(compiler: Compiler): void;
|
|
10
|
-
}
|
|
11
|
-
declare function resolvePluginOptions(compiler: Compiler, options?: MockServerPluginOptions): ResolvePluginOptions;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { BodyParserOptions, ExtraRequest, FormidableFile, LogLevel, LogType, Method, Middleware, MiddlewareOptions, MockCompiler, MockCompilerOptions, MockHttpItem, MockMatchPriority, MockMatchSpecialPriority, MockOptions, MockRequest, MockResponse, MockServerPlugin, MockServerPluginOptions, MockSocketOptions, MockWebsocketItem, ResponseBody, Server, ServerBuildOption, WebSocketSetupContext, createMockCompiler, createMockMiddleware, mockWebSocket, resolvePluginOptions };
|
package/dist/index.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { mockWebSocket, rewriteRequest, waitingFor } from "./logger-C48_LmdS.js";
|
|
2
|
-
import { MockCompiler, buildMockServer, createMockCompiler, createMockMiddleware, resolvePluginOptions } from "./resolvePluginOptions-DlkIkykz.js";
|
|
3
|
-
import { isString, toArray } from "@pengzhanbo/utils";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import process from "node:process";
|
|
6
|
-
import rspack from "@rspack/core";
|
|
7
|
-
|
|
8
|
-
//#region src/rspack.ts
|
|
9
|
-
const PLUGIN_NAME = "rspack-plugin-mock";
|
|
10
|
-
var MockServerPlugin = class {
|
|
11
|
-
constructor(options = {}) {
|
|
12
|
-
this.options = options;
|
|
13
|
-
}
|
|
14
|
-
apply(compiler) {
|
|
15
|
-
const compilerOptions = compiler.options;
|
|
16
|
-
const options = resolvePluginOptions$1(compiler, this.options);
|
|
17
|
-
if (process.env.NODE_ENV !== "production") {
|
|
18
|
-
const mockCompiler = createMockCompiler(options);
|
|
19
|
-
const mockMiddleware = createMockMiddleware(mockCompiler, options);
|
|
20
|
-
const setupMiddlewares = compilerOptions.devServer?.setupMiddlewares;
|
|
21
|
-
const waitServerForMockWebSocket = waitingFor((server) => {
|
|
22
|
-
mockWebSocket(mockCompiler, server, options);
|
|
23
|
-
});
|
|
24
|
-
compilerOptions.devServer = {
|
|
25
|
-
...compilerOptions.devServer,
|
|
26
|
-
setupMiddlewares: (middlewares, devServer) => {
|
|
27
|
-
middlewares = setupMiddlewares?.(middlewares, devServer) || middlewares;
|
|
28
|
-
const reload = () => {
|
|
29
|
-
if (devServer.webSocketServer?.clients) devServer.sendMessage(devServer.webSocketServer.clients, "static-changed");
|
|
30
|
-
};
|
|
31
|
-
middlewares = mockMiddleware(middlewares, reload) || middlewares;
|
|
32
|
-
/**
|
|
33
|
-
* 在 @rspack/dev-server -> webpack-dev-server 中, setupMiddlewares 优先于 createServer
|
|
34
|
-
* 执行,需要等待 server 启动后再注入 mock websocket
|
|
35
|
-
*/
|
|
36
|
-
waitServerForMockWebSocket(() => devServer.server);
|
|
37
|
-
return middlewares;
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
const wsPrefix = toArray(options.wsPrefix);
|
|
41
|
-
if (compilerOptions.devServer?.proxy?.length) {
|
|
42
|
-
const proxy = compilerOptions.devServer.proxy;
|
|
43
|
-
compilerOptions.devServer.proxy = proxy.filter((item) => {
|
|
44
|
-
if (typeof item !== "function" && item.ws === true && wsPrefix.length) return !toArray(item.context).filter(isString).some((context) => wsPrefix.includes(context));
|
|
45
|
-
return true;
|
|
46
|
-
}).map((item) => {
|
|
47
|
-
if (typeof item !== "function" && !item.ws) {
|
|
48
|
-
const onProxyReq = item.onProxyReq;
|
|
49
|
-
item.onProxyReq = (proxyReq, req, ...args) => {
|
|
50
|
-
onProxyReq?.(proxyReq, req, ...args);
|
|
51
|
-
rewriteRequest(proxyReq, req);
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
return item;
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
compiler.hooks.watchRun.tap(PLUGIN_NAME, () => mockCompiler.run());
|
|
58
|
-
compiler.hooks.watchClose.tap(PLUGIN_NAME, () => mockCompiler.close());
|
|
59
|
-
} else if (options.build !== false) compiler.hooks.afterEmit.tap(PLUGIN_NAME, () => buildMockServer(options, compilerOptions.output.path || path.resolve(process.cwd(), "dist")));
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
function resolvePluginOptions$1(compiler, options = {}) {
|
|
63
|
-
const compilerOptions = compiler.options;
|
|
64
|
-
const alias = compilerOptions.resolve?.alias || {};
|
|
65
|
-
const context = compilerOptions.context;
|
|
66
|
-
const definePluginInstance = compilerOptions.plugins?.find((plugin) => plugin instanceof rspack.DefinePlugin);
|
|
67
|
-
const proxies = (compilerOptions.devServer?.proxy || []).flatMap((item) => {
|
|
68
|
-
if (typeof item !== "function" && item.context && !item.ws) return item.context;
|
|
69
|
-
return [];
|
|
70
|
-
});
|
|
71
|
-
return resolvePluginOptions(options, {
|
|
72
|
-
alias,
|
|
73
|
-
context,
|
|
74
|
-
plugins: toArray(definePluginInstance),
|
|
75
|
-
proxies
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
//#endregion
|
|
80
|
-
export { MockCompiler, MockServerPlugin, createMockCompiler, createMockMiddleware, mockWebSocket, resolvePluginOptions$1 as resolvePluginOptions };
|