@modern-js/server 2.69.4 → 3.0.0-alpha.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/dist/cjs/createDevServer.js +98 -100
- package/dist/cjs/dev-tools/https/index.js +57 -49
- package/dist/cjs/dev-tools/watcher/dependencyTree.js +94 -92
- package/dist/cjs/dev-tools/watcher/index.js +129 -124
- package/dist/cjs/dev-tools/watcher/statsCache.js +84 -81
- package/dist/cjs/dev.js +104 -110
- package/dist/cjs/helpers/devOptions.js +55 -54
- package/dist/cjs/helpers/fileReader.js +48 -44
- package/dist/cjs/helpers/index.js +168 -107
- package/dist/cjs/helpers/mock.js +121 -124
- package/dist/cjs/helpers/repack.js +45 -39
- package/dist/cjs/helpers/utils.js +34 -26
- package/dist/cjs/index.js +33 -25
- package/dist/cjs/types.js +17 -15
- package/dist/esm/createDevServer.mjs +59 -0
- package/dist/esm/dev-tools/https/index.mjs +28 -0
- package/dist/esm/dev-tools/watcher/dependencyTree.mjs +57 -0
- package/dist/esm/dev-tools/watcher/index.mjs +88 -0
- package/dist/esm/dev-tools/watcher/statsCache.mjs +50 -0
- package/dist/esm/dev.mjs +77 -0
- package/dist/esm/helpers/devOptions.mjs +24 -0
- package/dist/esm/helpers/fileReader.mjs +18 -0
- package/dist/esm/helpers/index.mjs +65 -0
- package/dist/esm/helpers/mock.mjs +87 -0
- package/dist/esm/helpers/repack.mjs +16 -0
- package/dist/esm/helpers/utils.mjs +3 -0
- package/dist/{esm-node/index.js → esm/index.mjs} +1 -3
- package/dist/esm-node/createDevServer.mjs +59 -0
- package/dist/esm-node/dev-tools/https/index.mjs +28 -0
- package/dist/esm-node/dev-tools/watcher/dependencyTree.mjs +57 -0
- package/dist/esm-node/dev-tools/watcher/index.mjs +88 -0
- package/dist/esm-node/dev-tools/watcher/statsCache.mjs +50 -0
- package/dist/esm-node/dev.mjs +77 -0
- package/dist/esm-node/helpers/devOptions.mjs +24 -0
- package/dist/esm-node/helpers/fileReader.mjs +18 -0
- package/dist/esm-node/helpers/index.mjs +65 -0
- package/dist/esm-node/helpers/mock.mjs +87 -0
- package/dist/esm-node/helpers/repack.mjs +16 -0
- package/dist/esm-node/helpers/utils.mjs +3 -0
- package/dist/esm-node/index.mjs +2 -0
- package/dist/types/createDevServer.d.ts +1 -1
- package/dist/types/dev.d.ts +4 -4
- package/dist/types/helpers/devOptions.d.ts +10 -6
- package/dist/types/helpers/fileReader.d.ts +1 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/types/types.d.ts +48 -12
- package/package.json +42 -31
- package/rslib.config.mts +4 -0
- package/dist/cjs/helpers/constants.js +0 -49
- package/dist/esm/createDevServer.js +0 -154
- package/dist/esm/dev-tools/https/index.js +0 -74
- package/dist/esm/dev-tools/watcher/dependencyTree.js +0 -88
- package/dist/esm/dev-tools/watcher/index.js +0 -120
- package/dist/esm/dev-tools/watcher/statsCache.js +0 -80
- package/dist/esm/dev.js +0 -126
- package/dist/esm/helpers/constants.js +0 -25
- package/dist/esm/helpers/devOptions.js +0 -35
- package/dist/esm/helpers/fileReader.js +0 -43
- package/dist/esm/helpers/index.js +0 -123
- package/dist/esm/helpers/mock.js +0 -266
- package/dist/esm/helpers/repack.js +0 -20
- package/dist/esm/helpers/utils.js +0 -5
- package/dist/esm/index.js +0 -4
- package/dist/esm-node/createDevServer.js +0 -71
- package/dist/esm-node/dev-tools/https/index.js +0 -30
- package/dist/esm-node/dev-tools/watcher/dependencyTree.js +0 -67
- package/dist/esm-node/dev-tools/watcher/index.js +0 -100
- package/dist/esm-node/dev-tools/watcher/statsCache.js +0 -58
- package/dist/esm-node/dev.js +0 -93
- package/dist/esm-node/helpers/constants.js +0 -25
- package/dist/esm-node/helpers/devOptions.js +0 -35
- package/dist/esm-node/helpers/fileReader.js +0 -24
- package/dist/esm-node/helpers/index.js +0 -73
- package/dist/esm-node/helpers/mock.js +0 -104
- package/dist/esm-node/helpers/repack.js +0 -20
- package/dist/esm-node/helpers/utils.js +0 -5
- package/dist/types/helpers/constants.d.ts +0 -2
- /package/dist/esm/{types.js → types.mjs} +0 -0
- /package/dist/esm-node/{types.js → types.mjs} +0 -0
package/dist/esm-node/dev.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { connectMid2HonoMid } from "@modern-js/server-core/node";
|
|
2
|
-
import { API_DIR, SHARED_DIR } from "@modern-js/utils";
|
|
3
|
-
import { getDevOptions, getMockMiddleware, initFileReader, onRepack, startWatcher } from "./helpers";
|
|
4
|
-
const devPlugin = (options, compiler) => ({
|
|
5
|
-
name: "@modern-js/plugin-dev",
|
|
6
|
-
setup(api) {
|
|
7
|
-
const { config, pwd, builder, builderDevServer } = options;
|
|
8
|
-
const closeCb = [];
|
|
9
|
-
const dev = getDevOptions(options);
|
|
10
|
-
return {
|
|
11
|
-
async prepare() {
|
|
12
|
-
var _dev_after, _dev_before;
|
|
13
|
-
const { middlewares: builderMiddlewares, close, connectWebSocket } = builderDevServer || {};
|
|
14
|
-
close && closeCb.push(close);
|
|
15
|
-
const { middlewares, distDirectory, nodeServer, apiDirectory, sharedDirectory, serverBase } = api.useAppContext();
|
|
16
|
-
connectWebSocket && nodeServer && connectWebSocket({
|
|
17
|
-
server: nodeServer
|
|
18
|
-
});
|
|
19
|
-
const hooks = api.getHooks();
|
|
20
|
-
builder === null || builder === void 0 ? void 0 : builder.onDevCompileDone(({ stats }) => {
|
|
21
|
-
if (stats.toJson({
|
|
22
|
-
all: false
|
|
23
|
-
}).name !== "server") {
|
|
24
|
-
onRepack(distDirectory, hooks);
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
if (dev.watch) {
|
|
28
|
-
const { watchOptions } = config.server;
|
|
29
|
-
const watcher = startWatcher({
|
|
30
|
-
pwd,
|
|
31
|
-
distDir: distDirectory,
|
|
32
|
-
apiDir: apiDirectory || API_DIR,
|
|
33
|
-
sharedDir: sharedDirectory || SHARED_DIR,
|
|
34
|
-
watchOptions,
|
|
35
|
-
server: serverBase
|
|
36
|
-
});
|
|
37
|
-
closeCb.push(watcher.close.bind(watcher));
|
|
38
|
-
}
|
|
39
|
-
closeCb.length > 0 && (nodeServer === null || nodeServer === void 0 ? void 0 : nodeServer.on("close", () => {
|
|
40
|
-
closeCb.forEach((cb) => {
|
|
41
|
-
cb();
|
|
42
|
-
});
|
|
43
|
-
}));
|
|
44
|
-
const before = [];
|
|
45
|
-
const after = [];
|
|
46
|
-
const { setupMiddlewares = [] } = dev;
|
|
47
|
-
if (((_dev_after = dev.after) === null || _dev_after === void 0 ? void 0 : _dev_after.length) || ((_dev_before = dev.before) === null || _dev_before === void 0 ? void 0 : _dev_before.length)) {
|
|
48
|
-
setupMiddlewares.push((middlewares2) => {
|
|
49
|
-
middlewares2.unshift(...dev.before || []);
|
|
50
|
-
middlewares2.push(...dev.after || []);
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
setupMiddlewares.forEach((handler) => {
|
|
54
|
-
handler({
|
|
55
|
-
unshift: (...handlers) => before.unshift(...handlers),
|
|
56
|
-
push: (...handlers) => after.push(...handlers)
|
|
57
|
-
}, {
|
|
58
|
-
sockWrite: () => {
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
before.forEach((middleware, index) => {
|
|
63
|
-
middlewares.push({
|
|
64
|
-
name: `before-dev-server-${index}`,
|
|
65
|
-
handler: connectMid2HonoMid(middleware)
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
const mockMiddleware = await getMockMiddleware(pwd);
|
|
69
|
-
middlewares.push({
|
|
70
|
-
name: "mock-dev",
|
|
71
|
-
handler: mockMiddleware
|
|
72
|
-
});
|
|
73
|
-
builderMiddlewares && middlewares.push({
|
|
74
|
-
name: "rsbuild-dev",
|
|
75
|
-
handler: connectMid2HonoMid(builderMiddlewares)
|
|
76
|
-
});
|
|
77
|
-
after.forEach((middleware, index) => {
|
|
78
|
-
middlewares.push({
|
|
79
|
-
name: `after-dev-server-${index}`,
|
|
80
|
-
handler: connectMid2HonoMid(middleware)
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
middlewares.push({
|
|
84
|
-
name: "init-file-reader",
|
|
85
|
-
handler: initFileReader(compiler)
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
export {
|
|
92
|
-
devPlugin
|
|
93
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { HMR_SOCK_PATH } from "@modern-js/utils/universal/constants";
|
|
2
|
-
const getDefaultDevOptions = () => {
|
|
3
|
-
return {
|
|
4
|
-
client: {
|
|
5
|
-
path: HMR_SOCK_PATH,
|
|
6
|
-
// By default it is set to the port number of the dev server
|
|
7
|
-
port: "",
|
|
8
|
-
// By default it is set to "location.hostname"
|
|
9
|
-
host: "",
|
|
10
|
-
// By default it is set to "location.protocol === 'https:' ? 'wss' : 'ws'""
|
|
11
|
-
protocol: void 0
|
|
12
|
-
},
|
|
13
|
-
https: false,
|
|
14
|
-
devMiddleware: {
|
|
15
|
-
writeToDisk: true
|
|
16
|
-
},
|
|
17
|
-
watch: true,
|
|
18
|
-
hot: true,
|
|
19
|
-
compress: true,
|
|
20
|
-
liveReload: true
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export {
|
|
24
|
-
getDefaultDevOptions
|
|
25
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { merge } from "@modern-js/utils/lodash";
|
|
2
|
-
import { getDefaultDevOptions } from "./constants";
|
|
3
|
-
const getDevOptions = (options) => {
|
|
4
|
-
const devOptions = options.dev;
|
|
5
|
-
const defaultOptions = getDefaultDevOptions();
|
|
6
|
-
return merge(defaultOptions, devOptions);
|
|
7
|
-
};
|
|
8
|
-
const getDevAssetPrefix = (builder) => {
|
|
9
|
-
return new Promise((resolve) => {
|
|
10
|
-
if (!builder) {
|
|
11
|
-
return resolve("");
|
|
12
|
-
}
|
|
13
|
-
builder === null || builder === void 0 ? void 0 : builder.onAfterCreateCompiler((params) => {
|
|
14
|
-
var _webCompiler_options_output, _webCompiler_options;
|
|
15
|
-
let webCompiler;
|
|
16
|
-
if ("compilers" in params.compiler) {
|
|
17
|
-
webCompiler = params.compiler.compilers.find((c) => {
|
|
18
|
-
return c.name === "web" || c.name === "client";
|
|
19
|
-
});
|
|
20
|
-
} else {
|
|
21
|
-
webCompiler = params.compiler;
|
|
22
|
-
}
|
|
23
|
-
const publicPath = webCompiler === null || webCompiler === void 0 ? void 0 : (_webCompiler_options = webCompiler.options) === null || _webCompiler_options === void 0 ? void 0 : (_webCompiler_options_output = _webCompiler_options.output) === null || _webCompiler_options_output === void 0 ? void 0 : _webCompiler_options_output.publicPath;
|
|
24
|
-
if (publicPath && typeof publicPath === "string") {
|
|
25
|
-
const formatPublicPath = publicPath.replace(/^https?:\/\/[^/]+/, "");
|
|
26
|
-
return resolve(formatPublicPath);
|
|
27
|
-
}
|
|
28
|
-
return resolve("");
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
export {
|
|
33
|
-
getDevAssetPrefix,
|
|
34
|
-
getDevOptions
|
|
35
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { fileReader } from "@modern-js/runtime-utils/fileReader";
|
|
2
|
-
const initFileReader = (compiler) => {
|
|
3
|
-
let isInit = false;
|
|
4
|
-
return async (ctx, next) => {
|
|
5
|
-
if (isInit) {
|
|
6
|
-
return next();
|
|
7
|
-
}
|
|
8
|
-
isInit = true;
|
|
9
|
-
if (!compiler) {
|
|
10
|
-
fileReader.reset();
|
|
11
|
-
return next();
|
|
12
|
-
}
|
|
13
|
-
const { outputFileSystem } = "compilers" in compiler ? compiler.compilers[0] : compiler;
|
|
14
|
-
if (outputFileSystem) {
|
|
15
|
-
fileReader.reset(outputFileSystem);
|
|
16
|
-
} else {
|
|
17
|
-
fileReader.reset();
|
|
18
|
-
}
|
|
19
|
-
return next();
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
initFileReader
|
|
24
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
import { AGGRED_DIR } from "@modern-js/server-core";
|
|
3
|
-
import { SERVER_BUNDLE_DIRECTORY, SERVER_DIR, logger } from "@modern-js/utils";
|
|
4
|
-
import Watcher, { mergeWatchOptions } from "../dev-tools/watcher";
|
|
5
|
-
import { initOrUpdateMockMiddlewares } from "./mock";
|
|
6
|
-
import { debug } from "./utils";
|
|
7
|
-
export * from "./repack";
|
|
8
|
-
export * from "./devOptions";
|
|
9
|
-
export * from "./fileReader";
|
|
10
|
-
export * from "./mock";
|
|
11
|
-
async function onServerChange({ pwd, filepath, event, server }) {
|
|
12
|
-
const { mock } = AGGRED_DIR;
|
|
13
|
-
const mockPath = path.normalize(path.join(pwd, mock));
|
|
14
|
-
const { hooks } = server;
|
|
15
|
-
if (filepath.startsWith(mockPath)) {
|
|
16
|
-
await initOrUpdateMockMiddlewares(pwd);
|
|
17
|
-
logger.info("Finish update the mock handlers");
|
|
18
|
-
} else {
|
|
19
|
-
try {
|
|
20
|
-
const fileChangeEvent = {
|
|
21
|
-
type: "file-change",
|
|
22
|
-
payload: [
|
|
23
|
-
{
|
|
24
|
-
filename: filepath,
|
|
25
|
-
event
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
};
|
|
29
|
-
await hooks.onReset.call({
|
|
30
|
-
event: fileChangeEvent
|
|
31
|
-
});
|
|
32
|
-
debug(`Finish reload server, trigger by ${filepath} ${event}`);
|
|
33
|
-
} catch (e) {
|
|
34
|
-
logger.error(e);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
function startWatcher({ pwd, distDir, apiDir, sharedDir, watchOptions, server }) {
|
|
39
|
-
const { mock } = AGGRED_DIR;
|
|
40
|
-
const defaultWatched = [
|
|
41
|
-
`${mock}/**/*`,
|
|
42
|
-
`${SERVER_DIR}/**/*`,
|
|
43
|
-
`${apiDir}/**`,
|
|
44
|
-
`${sharedDir}/**/*`,
|
|
45
|
-
`${distDir}/${SERVER_BUNDLE_DIRECTORY}/*-server-loaders.js`
|
|
46
|
-
];
|
|
47
|
-
const mergedWatchOptions = mergeWatchOptions(watchOptions);
|
|
48
|
-
const defaultWatchedPaths = defaultWatched.map((p) => {
|
|
49
|
-
const finalPath = path.isAbsolute(p) ? p : path.join(pwd, p);
|
|
50
|
-
return path.normalize(finalPath);
|
|
51
|
-
});
|
|
52
|
-
const watcher = new Watcher();
|
|
53
|
-
watcher.createDepTree();
|
|
54
|
-
watcher.listen(defaultWatchedPaths, mergedWatchOptions, (filepath, event) => {
|
|
55
|
-
if (filepath.includes("-server-loaders.js")) {
|
|
56
|
-
delete require.cache[filepath];
|
|
57
|
-
return;
|
|
58
|
-
} else {
|
|
59
|
-
watcher.updateDepTree();
|
|
60
|
-
watcher.cleanDepCache(filepath);
|
|
61
|
-
}
|
|
62
|
-
onServerChange({
|
|
63
|
-
pwd,
|
|
64
|
-
filepath,
|
|
65
|
-
event,
|
|
66
|
-
server
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
return watcher;
|
|
70
|
-
}
|
|
71
|
-
export {
|
|
72
|
-
startWatcher
|
|
73
|
-
};
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { AGGRED_DIR } from "@modern-js/server-core";
|
|
3
|
-
import { connectMockMid2HonoMid } from "@modern-js/server-core/node";
|
|
4
|
-
import { fs } from "@modern-js/utils";
|
|
5
|
-
import { match } from "path-to-regexp";
|
|
6
|
-
let mockAPIs = [];
|
|
7
|
-
let mockConfig;
|
|
8
|
-
const parseKey = (key) => {
|
|
9
|
-
const _blank = " ";
|
|
10
|
-
const splitted = key.split(_blank).filter(Boolean);
|
|
11
|
-
if (splitted.length > 1) {
|
|
12
|
-
const [method, pathname] = splitted;
|
|
13
|
-
return {
|
|
14
|
-
method: method.toLowerCase(),
|
|
15
|
-
path: pathname
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
return {
|
|
19
|
-
method: "get",
|
|
20
|
-
path: key
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
const getMockModule = async (pwd) => {
|
|
24
|
-
const exts = [
|
|
25
|
-
".ts",
|
|
26
|
-
".js"
|
|
27
|
-
];
|
|
28
|
-
let mockFilePath = "";
|
|
29
|
-
for (const ext of exts) {
|
|
30
|
-
const maybeMatch = path.join(pwd, `${AGGRED_DIR.mock}/index${ext}`);
|
|
31
|
-
if (await fs.pathExists(maybeMatch)) {
|
|
32
|
-
mockFilePath = maybeMatch;
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
if (!mockFilePath) {
|
|
37
|
-
return void 0;
|
|
38
|
-
}
|
|
39
|
-
const { default: mockHandlers, config } = await import(mockFilePath);
|
|
40
|
-
const enable = config === null || config === void 0 ? void 0 : config.enable;
|
|
41
|
-
if (enable === false) {
|
|
42
|
-
return void 0;
|
|
43
|
-
}
|
|
44
|
-
if (!mockHandlers) {
|
|
45
|
-
throw new Error(`Mock file ${mockFilePath} parsed failed!`);
|
|
46
|
-
}
|
|
47
|
-
return {
|
|
48
|
-
mockHandlers,
|
|
49
|
-
config
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
const getMatched = (request, mockApis) => {
|
|
53
|
-
const { path: targetPathname, method: targetMethod } = request;
|
|
54
|
-
const matched = mockApis.find((mockApi) => {
|
|
55
|
-
const { method, path: pathname } = mockApi;
|
|
56
|
-
if (method.toLowerCase() === targetMethod.toLowerCase()) {
|
|
57
|
-
return match(pathname, {
|
|
58
|
-
encode: encodeURI,
|
|
59
|
-
decode: decodeURIComponent
|
|
60
|
-
})(targetPathname);
|
|
61
|
-
}
|
|
62
|
-
return false;
|
|
63
|
-
});
|
|
64
|
-
return matched;
|
|
65
|
-
};
|
|
66
|
-
async function initOrUpdateMockMiddlewares(pwd) {
|
|
67
|
-
const mockModule = await getMockModule(pwd);
|
|
68
|
-
mockConfig = mockModule === null || mockModule === void 0 ? void 0 : mockModule.config;
|
|
69
|
-
mockAPIs = Object.entries((mockModule === null || mockModule === void 0 ? void 0 : mockModule.mockHandlers) || {}).map(([key, handler]) => {
|
|
70
|
-
const { method, path: path2 } = parseKey(key);
|
|
71
|
-
return {
|
|
72
|
-
method,
|
|
73
|
-
path: path2,
|
|
74
|
-
handler
|
|
75
|
-
};
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
async function getMockMiddleware(pwd) {
|
|
79
|
-
await initOrUpdateMockMiddlewares(pwd);
|
|
80
|
-
const mockMiddleware = async (c, next) => {
|
|
81
|
-
if (typeof (mockConfig === null || mockConfig === void 0 ? void 0 : mockConfig.enable) === "function") {
|
|
82
|
-
const isEnabled = mockConfig.enable(c.env.node.req, c.env.node.res);
|
|
83
|
-
if (!isEnabled) {
|
|
84
|
-
return next();
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
const matchedMockAPI = getMatched(c.req, mockAPIs);
|
|
88
|
-
if (matchedMockAPI) {
|
|
89
|
-
const { handler } = matchedMockAPI;
|
|
90
|
-
if (typeof handler === "function") {
|
|
91
|
-
return await connectMockMid2HonoMid(handler)(c, next);
|
|
92
|
-
} else {
|
|
93
|
-
return c.json(handler);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
return next();
|
|
97
|
-
};
|
|
98
|
-
return mockMiddleware;
|
|
99
|
-
}
|
|
100
|
-
export {
|
|
101
|
-
getMatched,
|
|
102
|
-
getMockMiddleware,
|
|
103
|
-
initOrUpdateMockMiddlewares
|
|
104
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { fileReader } from "@modern-js/runtime-utils/fileReader";
|
|
2
|
-
const cleanSSRCache = (distDir) => {
|
|
3
|
-
Object.keys(require.cache).forEach((key) => {
|
|
4
|
-
if (key.startsWith(distDir)) {
|
|
5
|
-
delete require.cache[key];
|
|
6
|
-
}
|
|
7
|
-
});
|
|
8
|
-
};
|
|
9
|
-
const onRepack = (distDir, hooks) => {
|
|
10
|
-
cleanSSRCache(distDir);
|
|
11
|
-
fileReader.reset();
|
|
12
|
-
hooks.onReset.call({
|
|
13
|
-
event: {
|
|
14
|
-
type: "repack"
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
onRepack
|
|
20
|
-
};
|
|
File without changes
|
|
File without changes
|