@rsbuild/core 2.0.0-alpha.1 → 2.0.0-alpha.3
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/compiled/chokidar/handler.d.ts +90 -0
- package/compiled/chokidar/index.d.ts +34 -201
- package/compiled/chokidar/package.json +1 -1
- package/compiled/css-loader/index.js +2 -2
- package/compiled/html-rspack-plugin/index.js +18 -15
- package/compiled/html-rspack-plugin/package.json +1 -1
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/rslog/package.json +1 -1
- package/compiled/rspack-chain/package.json +1 -1
- package/dist/131.js +69 -49
- package/dist/397.js +11 -0
- package/dist/7.js +1 -0
- package/dist/chokidar.js +1044 -0
- package/dist/chokidar.js.LICENSE.txt +1 -0
- package/dist/client/hmr.js +33 -0
- package/dist/cors.js +2 -2
- package/dist/manifest-plugin.js +5 -5
- package/dist/memfs.js +3334 -857
- package/dist/open.js +1 -1
- package/dist/tinyglobby.js +9 -1
- package/dist-types/configChain.d.ts +21 -21
- package/dist-types/helpers/vendors.d.ts +0 -1
- package/dist-types/loadConfig.d.ts +1 -1
- package/dist-types/server/socketServer.d.ts +8 -1
- package/dist-types/types/config.d.ts +5 -0
- package/package.json +8 -8
- package/types.d.ts +8 -4
- package/compiled/chokidar/index.js +0 -1793
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */
|
package/dist/client/hmr.js
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import { logger } from "./59.js";
|
|
2
2
|
let createOverlay;
|
|
3
3
|
let clearOverlay;
|
|
4
|
+
function setupCustomHMRListeners(customListenersMap) {
|
|
5
|
+
__webpack_require__.i.push(({ module })=>{
|
|
6
|
+
const newListeners = new Map();
|
|
7
|
+
const addToMap = (map, event, cb)=>{
|
|
8
|
+
const existing = map.get(event) || [];
|
|
9
|
+
existing.push(cb);
|
|
10
|
+
map.set(event, existing);
|
|
11
|
+
};
|
|
12
|
+
module.hot.on = (event, cb)=>{
|
|
13
|
+
addToMap(customListenersMap, event, cb);
|
|
14
|
+
addToMap(newListeners, event, cb);
|
|
15
|
+
};
|
|
16
|
+
module.hot.dispose(()=>{
|
|
17
|
+
for (const [event, staleFns] of newListeners){
|
|
18
|
+
const listeners = customListenersMap.get(event);
|
|
19
|
+
if (listeners) customListenersMap.set(event, listeners.filter((l)=>!staleFns.includes(l)));
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
}
|
|
4
24
|
const registerOverlay = (createFn, clearFn)=>{
|
|
5
25
|
createOverlay = createFn;
|
|
6
26
|
clearOverlay = clearFn;
|
|
@@ -9,6 +29,7 @@ function init(token, config, serverHost, serverPort, liveReload, browserLogs, lo
|
|
|
9
29
|
logger.level = logLevel;
|
|
10
30
|
const queuedMessages = [];
|
|
11
31
|
const clientErrors = [];
|
|
32
|
+
const customListenersMap = new Map();
|
|
12
33
|
let lastHash;
|
|
13
34
|
let hasBuildErrors = false;
|
|
14
35
|
function formatURL(fallback) {
|
|
@@ -124,6 +145,17 @@ function init(token, config, serverHost, serverPort, liveReload, browserLogs, lo
|
|
|
124
145
|
case 'resolved-client-error':
|
|
125
146
|
handleResolvedClientError(message.data);
|
|
126
147
|
break;
|
|
148
|
+
case 'custom':
|
|
149
|
+
{
|
|
150
|
+
const { event, data } = message.data;
|
|
151
|
+
if (event) {
|
|
152
|
+
const cbs = customListenersMap.get(event);
|
|
153
|
+
if (cbs) cbs.forEach((cb)=>{
|
|
154
|
+
cb(data);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
127
159
|
}
|
|
128
160
|
}
|
|
129
161
|
function onClose() {
|
|
@@ -200,6 +232,7 @@ function init(token, config, serverHost, serverPort, liveReload, browserLogs, lo
|
|
|
200
232
|
});
|
|
201
233
|
window.addEventListener('unhandledrejection', onUnhandledRejection);
|
|
202
234
|
}
|
|
235
|
+
if (module.hot) setupCustomHMRListeners(customListenersMap);
|
|
203
236
|
connect();
|
|
204
237
|
}
|
|
205
238
|
export { init, registerOverlay };
|
package/dist/cors.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! For license information please see cors.js.LICENSE.txt */
|
|
2
2
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
3
3
|
__webpack_require__.add({
|
|
4
|
-
"../../node_modules/.pnpm/cors@2.8.
|
|
4
|
+
"../../node_modules/.pnpm/cors@2.8.6/node_modules/cors/lib/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
5
5
|
!function() {
|
|
6
6
|
'use strict';
|
|
7
7
|
var assign = __webpack_require__("../../node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js"), vary = __webpack_require__("../../node_modules/.pnpm/vary@1.1.2/node_modules/vary/index.js"), defaults = {
|
|
@@ -93,7 +93,7 @@ __webpack_require__.add({
|
|
|
93
93
|
}
|
|
94
94
|
function cors(options, req, res, next) {
|
|
95
95
|
var headers = [];
|
|
96
|
-
'OPTIONS' === (req.method && req.method.toUpperCase && req.method.toUpperCase()) ? (headers.push(configureOrigin(options, req)), headers.push(configureCredentials(options
|
|
96
|
+
'OPTIONS' === (req.method && req.method.toUpperCase && req.method.toUpperCase()) ? (headers.push(configureOrigin(options, req)), headers.push(configureCredentials(options)), headers.push(configureMethods(options)), headers.push(configureAllowedHeaders(options, req)), headers.push(configureMaxAge(options)), headers.push(configureExposedHeaders(options)), applyHeaders(headers, res), options.preflightContinue ? next() : (res.statusCode = options.optionsSuccessStatus, res.setHeader('Content-Length', '0'), res.end())) : (headers.push(configureOrigin(options, req)), headers.push(configureCredentials(options)), headers.push(configureExposedHeaders(options)), applyHeaders(headers, res), next());
|
|
97
97
|
}
|
|
98
98
|
module.exports = function middlewareWrapper(o) {
|
|
99
99
|
var optionsCallback = null;
|
package/dist/manifest-plugin.js
CHANGED
|
@@ -2,7 +2,7 @@ import * as __rspack_external__rspack_lite_tapable_c6bdf810 from "@rspack/lite-t
|
|
|
2
2
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
3
3
|
import "./131.js";
|
|
4
4
|
__webpack_require__.add({
|
|
5
|
-
"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-
|
|
5
|
+
"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-alpha.0_@module-federation+runtime-tools@0.23.0_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/helpers.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
6
6
|
Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
value: !0
|
|
8
8
|
}), exports.transformFiles = exports.reduceChunk = exports.reduceAssets = exports.generateManifest = void 0;
|
|
@@ -64,11 +64,11 @@ __webpack_require__.add({
|
|
|
64
64
|
'sort'
|
|
65
65
|
].filter((fname)=>!!options[fname]).reduce((prev, fname)=>prev[fname](options[fname]), files).map(standardizeFilePaths);
|
|
66
66
|
},
|
|
67
|
-
"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-
|
|
67
|
+
"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-alpha.0_@module-federation+runtime-tools@0.23.0_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/hooks.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
68
68
|
Object.defineProperty(exports, "__esModule", {
|
|
69
69
|
value: !0
|
|
70
70
|
}), exports.normalModuleLoaderHook = exports.getCompilerHooks = exports.emitHook = exports.beforeRunHook = void 0;
|
|
71
|
-
let node_fs_1 = __webpack_require__("node:fs"), node_path_1 = __webpack_require__("node:path"), lite_tapable_1 = __webpack_require__("@rspack/lite-tapable"), helpers_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-
|
|
71
|
+
let node_fs_1 = __webpack_require__("node:fs"), node_path_1 = __webpack_require__("node:path"), lite_tapable_1 = __webpack_require__("@rspack/lite-tapable"), helpers_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-alpha.0_@module-federation+runtime-tools@0.23.0_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/helpers.js"), compilerHookMap = new WeakMap(), getCompilerHooks = (compiler)=>{
|
|
72
72
|
let hooks = compilerHookMap.get(compiler);
|
|
73
73
|
return void 0 === hooks && (hooks = {
|
|
74
74
|
afterEmit: new lite_tapable_1.SyncWaterfallHook([
|
|
@@ -122,9 +122,9 @@ __webpack_require__.add({
|
|
|
122
122
|
}), emitFile.call(module, file, content, sourceMap));
|
|
123
123
|
};
|
|
124
124
|
},
|
|
125
|
-
"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-
|
|
125
|
+
"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-alpha.0_@module-federation+runtime-tools@0.23.0_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/index.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
126
126
|
exports.RspackManifestPlugin = void 0;
|
|
127
|
-
let node_path_1 = __webpack_require__("node:path"), hooks_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-
|
|
127
|
+
let node_path_1 = __webpack_require__("node:path"), hooks_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-alpha.0_@module-federation+runtime-tools@0.23.0_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/hooks.js"), emitCountMap = new Map(), defaults = {
|
|
128
128
|
assetHookStage: 1 / 0,
|
|
129
129
|
basePath: '',
|
|
130
130
|
fileName: 'manifest.json',
|