@rsbuild/core 1.7.1 → 2.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/compiled/css-loader/index.js +2 -2
- package/compiled/html-rspack-plugin/index.js +14 -14
- package/compiled/http-proxy-middleware/index.d.ts +2 -2
- package/compiled/postcss/index.js +1 -1
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/ws/index.js +59 -54
- package/compiled/ws/package.json +1 -1
- package/dist/131.js +1070 -1122
- package/dist/31.js +336 -0
- package/dist/710.js +445 -0
- package/dist/743.js +7 -0
- package/dist/{136.mjs → 88.js} +11 -13
- package/dist/client/hmr.js +0 -1
- package/dist/client/overlay.js +32 -21
- package/dist/connect.js +581 -0
- package/dist/connect.js.LICENSE.txt +54 -0
- package/dist/cors.js +188 -0
- package/dist/cors.js.LICENSE.txt +11 -0
- package/dist/launch-editor-middleware.js +439 -0
- package/dist/manifest-plugin.js +177 -0
- package/dist/memfs.js +3644 -0
- package/dist/{0~open.js → open.js} +21 -13
- package/dist/{0~range-parser.js → range-parser.js} +1 -1
- package/dist/remapping.js +196 -0
- package/dist/sirv.js +122 -0
- package/dist/tinyglobby.js +1463 -0
- package/dist/transformLoader.mjs +1 -1
- package/dist/transformRawLoader.mjs +1 -1
- package/dist-types/{provider/build.d.ts → build.d.ts} +2 -2
- package/dist-types/cli/commands.d.ts +1 -1
- package/dist-types/configChain.d.ts +0 -2
- package/dist-types/constants.d.ts +2 -3
- package/dist-types/{provider/createCompiler.d.ts → createCompiler.d.ts} +1 -1
- package/dist-types/defaultConfig.d.ts +1 -1
- package/dist-types/helpers/fs.d.ts +4 -0
- package/dist-types/helpers/index.d.ts +1 -1
- package/dist-types/helpers/url.d.ts +0 -1
- package/dist-types/helpers/vendors.d.ts +0 -13
- package/dist-types/hooks.d.ts +3 -5
- package/dist-types/index.d.ts +1 -1
- package/dist-types/{provider/initConfigs.d.ts → initConfigs.d.ts} +1 -1
- package/dist-types/inspectConfig.d.ts +5 -33
- package/dist-types/pluginHelper.d.ts +1 -1
- package/dist-types/plugins/css.d.ts +1 -1
- package/dist-types/plugins/inlineChunk.d.ts +1 -1
- package/dist-types/plugins/minimize.d.ts +2 -2
- package/dist-types/{provider/rspackConfig.d.ts → rspackConfig.d.ts} +1 -1
- package/dist-types/server/assets-middleware/getFileFromUrl.d.ts +1 -2
- package/dist-types/server/assets-middleware/setupOutputFileSystem.d.ts +1 -1
- package/dist-types/server/browserLogs.d.ts +1 -1
- package/dist-types/server/devMiddlewares.d.ts +1 -1
- package/dist-types/server/devServer.d.ts +1 -1
- package/dist-types/server/gzipMiddleware.d.ts +1 -1
- package/dist-types/server/helper.d.ts +13 -10
- package/dist-types/server/proxy.d.ts +2 -2
- package/dist-types/server/socketServer.d.ts +1 -1
- package/dist-types/types/config.d.ts +7 -51
- package/dist-types/types/context.d.ts +3 -2
- package/dist-types/types/hooks.d.ts +9 -9
- package/dist-types/types/plugin.d.ts +3 -40
- package/dist-types/types/rsbuild.d.ts +6 -31
- package/dist-types/types/thirdParty.d.ts +1 -4
- package/package.json +15 -20
- package/compiled/@jridgewell/remapping/index.d.ts +0 -1
- package/compiled/@jridgewell/remapping/index.js +0 -1222
- package/compiled/@jridgewell/remapping/license +0 -19
- package/compiled/@jridgewell/remapping/package.json +0 -1
- package/compiled/@jridgewell/trace-mapping/index.d.ts +0 -194
- package/compiled/@jridgewell/trace-mapping/index.js +0 -1408
- package/compiled/@jridgewell/trace-mapping/license +0 -19
- package/compiled/@jridgewell/trace-mapping/package.json +0 -1
- package/compiled/connect/index.d.ts +0 -90
- package/compiled/connect/index.js +0 -1240
- package/compiled/connect/license +0 -25
- package/compiled/connect/package.json +0 -1
- package/compiled/cors/index.d.ts +0 -56
- package/compiled/cors/index.js +0 -371
- package/compiled/cors/license +0 -22
- package/compiled/cors/package.json +0 -1
- package/compiled/launch-editor-middleware/index.d.ts +0 -1
- package/compiled/launch-editor-middleware/index.js +0 -719
- package/compiled/launch-editor-middleware/license +0 -21
- package/compiled/launch-editor-middleware/package.json +0 -1
- package/compiled/memfs/index.d.ts +0 -1462
- package/compiled/memfs/index.js +0 -1
- package/compiled/memfs/license +0 -201
- package/compiled/memfs/package.json +0 -1
- package/compiled/mrmime/index.d.ts +0 -4
- package/compiled/mrmime/index.js +0 -456
- package/compiled/mrmime/package.json +0 -1
- package/compiled/picocolors/index.d.ts +0 -55
- package/compiled/picocolors/index.js +0 -108
- package/compiled/picocolors/license +0 -15
- package/compiled/picocolors/package.json +0 -1
- package/compiled/rspack-manifest-plugin/index.d.ts +0 -48
- package/compiled/rspack-manifest-plugin/index.js +0 -409
- package/compiled/rspack-manifest-plugin/license +0 -21
- package/compiled/rspack-manifest-plugin/package.json +0 -1
- package/compiled/sirv/index.d.ts +0 -1
- package/compiled/sirv/index.js +0 -274
- package/compiled/sirv/package.json +0 -1
- package/compiled/tinyglobby/index.d.ts +0 -46
- package/compiled/tinyglobby/index.js +0 -2664
- package/compiled/tinyglobby/license +0 -21
- package/compiled/tinyglobby/package.json +0 -1
- package/compiled/webpack-bundle-analyzer/index.d.ts +0 -160
- package/compiled/webpack-bundle-analyzer/index.js +0 -23
- package/compiled/webpack-bundle-analyzer/license +0 -20
- package/compiled/webpack-bundle-analyzer/package.json +0 -1
- package/compiled/webpack-bundle-analyzer/public/viewer.js +0 -16
- package/compiled/webpack-bundle-analyzer/public/viewer.js.LICENSE.txt +0 -10
- package/dist/2~open.cjs +0 -436
- package/dist/2~range-parser.cjs +0 -52
- package/dist/2~range-parser.cjs.LICENSE.txt +0 -6
- package/dist/index.cjs +0 -9442
- package/dist/index.cjs.LICENSE.txt +0 -26
- package/dist-types/plugins/bundleAnalyzer.d.ts +0 -2
- package/dist-types/plugins/performance.d.ts +0 -5
- package/dist-types/provider/helpers.d.ts +0 -12
- package/dist-types/provider/provider.d.ts +0 -2
- /package/dist/{0~range-parser.js.LICENSE.txt → range-parser.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import * as __rspack_external__rspack_lite_tapable_c6bdf810 from "@rspack/lite-tapable";
|
|
2
|
+
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
3
|
+
import "./131.js";
|
|
4
|
+
__webpack_require__.add({
|
|
5
|
+
"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.0_@rspack+core@1.7.2_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/helpers.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: !0
|
|
8
|
+
}), exports.transformFiles = exports.reduceChunk = exports.reduceAssets = exports.generateManifest = void 0;
|
|
9
|
+
let node_path_1 = __webpack_require__("node:path");
|
|
10
|
+
exports.generateManifest = (compilation, files, { generate, seed = {} })=>generate ? generate(seed, files, Array.from(compilation.entrypoints.entries()).reduce((e, [name, entrypoint])=>Object.assign(e, {
|
|
11
|
+
[name]: entrypoint.getFiles()
|
|
12
|
+
}), {}), {
|
|
13
|
+
compilation
|
|
14
|
+
}) : files.reduce((manifest, file)=>Object.assign(manifest, {
|
|
15
|
+
[file.name]: file.path
|
|
16
|
+
}), seed), exports.reduceAssets = (files, asset, moduleAssets)=>{
|
|
17
|
+
let name;
|
|
18
|
+
return (moduleAssets[asset.name] ? name = moduleAssets[asset.name] : asset.info.sourceFilename && (name = (0, node_path_1.join)((0, node_path_1.dirname)(asset.name), (0, node_path_1.basename)(asset.info.sourceFilename))), name) ? files.concat({
|
|
19
|
+
isAsset: !0,
|
|
20
|
+
isChunk: !1,
|
|
21
|
+
isInitial: !1,
|
|
22
|
+
isModuleAsset: !0,
|
|
23
|
+
name,
|
|
24
|
+
path: asset.name
|
|
25
|
+
}) : asset.chunks && asset.chunks.length > 0 ? files : files.concat({
|
|
26
|
+
isAsset: !0,
|
|
27
|
+
isChunk: !1,
|
|
28
|
+
isInitial: !1,
|
|
29
|
+
isModuleAsset: !1,
|
|
30
|
+
name: asset.name,
|
|
31
|
+
path: asset.name
|
|
32
|
+
});
|
|
33
|
+
}, exports.reduceChunk = (files, chunk, options, auxiliaryFiles)=>(Array.from(chunk.auxiliaryFiles || []).forEach((auxiliaryFile)=>{
|
|
34
|
+
auxiliaryFiles[auxiliaryFile] = {
|
|
35
|
+
isAsset: !0,
|
|
36
|
+
isChunk: !1,
|
|
37
|
+
isInitial: !1,
|
|
38
|
+
isModuleAsset: !0,
|
|
39
|
+
name: (0, node_path_1.basename)(auxiliaryFile),
|
|
40
|
+
path: auxiliaryFile
|
|
41
|
+
};
|
|
42
|
+
}), Array.from(chunk.files).reduce((prev, path)=>{
|
|
43
|
+
let name = chunk.name ? chunk.name : null;
|
|
44
|
+
return name = name ? options.useEntryKeys && !path.endsWith('.map') ? name : `${name}.${((fileName, { transformExtensions })=>{
|
|
45
|
+
let split = fileName.replace(/\?.*/, '').split('.'), extension = split.pop();
|
|
46
|
+
return transformExtensions.test(extension) ? `${split.pop()}.${extension}` : extension;
|
|
47
|
+
})(path, options)}` : path, prev.concat({
|
|
48
|
+
chunk,
|
|
49
|
+
isAsset: !1,
|
|
50
|
+
isChunk: !0,
|
|
51
|
+
isInitial: chunk.isOnlyInitial(),
|
|
52
|
+
isModuleAsset: !1,
|
|
53
|
+
name,
|
|
54
|
+
path
|
|
55
|
+
});
|
|
56
|
+
}, files));
|
|
57
|
+
let standardizeFilePaths = (file)=>{
|
|
58
|
+
let result = Object.assign({}, file);
|
|
59
|
+
return result.name = file.name.replace(/\\/g, '/'), result.path = file.path.replace(/\\/g, '/'), result;
|
|
60
|
+
};
|
|
61
|
+
exports.transformFiles = (files, options)=>[
|
|
62
|
+
'filter',
|
|
63
|
+
'map',
|
|
64
|
+
'sort'
|
|
65
|
+
].filter((fname)=>!!options[fname]).reduce((prev, fname)=>prev[fname](options[fname]), files).map(standardizeFilePaths);
|
|
66
|
+
},
|
|
67
|
+
"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.0_@rspack+core@1.7.2_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/hooks.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
68
|
+
Object.defineProperty(exports, "__esModule", {
|
|
69
|
+
value: !0
|
|
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.0_@rspack+core@1.7.2_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/helpers.js"), compilerHookMap = new WeakMap(), getCompilerHooks = (compiler)=>{
|
|
72
|
+
let hooks = compilerHookMap.get(compiler);
|
|
73
|
+
return void 0 === hooks && (hooks = {
|
|
74
|
+
afterEmit: new lite_tapable_1.SyncWaterfallHook([
|
|
75
|
+
'manifest'
|
|
76
|
+
]),
|
|
77
|
+
beforeEmit: new lite_tapable_1.SyncWaterfallHook([
|
|
78
|
+
'manifest'
|
|
79
|
+
])
|
|
80
|
+
}, compilerHookMap.set(compiler, hooks)), hooks;
|
|
81
|
+
};
|
|
82
|
+
exports.getCompilerHooks = getCompilerHooks, exports.beforeRunHook = ({ emitCountMap, manifestFileName }, _, callback)=>{
|
|
83
|
+
let emitCount = emitCountMap.get(manifestFileName) || 0;
|
|
84
|
+
emitCountMap.set(manifestFileName, emitCount + 1), callback && callback();
|
|
85
|
+
}, exports.emitHook = function emit({ compiler, emitCountMap, manifestAssetId, manifestFileName, moduleAssets, options }, compilation) {
|
|
86
|
+
var _a;
|
|
87
|
+
let emitCount = emitCountMap.get(manifestFileName) - 1, stats = compilation.getStats().toJson({
|
|
88
|
+
all: !1,
|
|
89
|
+
assets: !0,
|
|
90
|
+
cachedAssets: !0,
|
|
91
|
+
ids: !0,
|
|
92
|
+
publicPath: !0
|
|
93
|
+
}), resolvedPublicPath = null !== options.publicPath ? options.publicPath : stats.publicPath, publicPath = 'auto' === resolvedPublicPath ? '' : resolvedPublicPath, { basePath, removeKeyHash } = options;
|
|
94
|
+
emitCountMap.set(manifestFileName, emitCount);
|
|
95
|
+
let auxiliaryFiles = {}, files = Array.from(compilation.chunks).reduce((prev, chunk)=>(0, helpers_1.reduceChunk)(prev, chunk, options, auxiliaryFiles), []);
|
|
96
|
+
(files = (files = stats.assets.reduce((prev, asset)=>(0, helpers_1.reduceAssets)(prev, asset, moduleAssets), files)).filter(({ name, path })=>{
|
|
97
|
+
var _a;
|
|
98
|
+
return !path.includes('hot-update') && void 0 === emitCountMap.get((0, node_path_1.join)((null == (_a = compiler.options.output) ? void 0 : _a.path) || '<unknown>', name));
|
|
99
|
+
})).forEach((file)=>{
|
|
100
|
+
delete auxiliaryFiles[file.path];
|
|
101
|
+
}), Object.keys(auxiliaryFiles).forEach((auxiliaryFile)=>{
|
|
102
|
+
files = files.concat(auxiliaryFiles[auxiliaryFile]);
|
|
103
|
+
});
|
|
104
|
+
let integrityMap = {};
|
|
105
|
+
null == (_a = stats.assets) || _a.forEach((asset)=>{
|
|
106
|
+
asset.integrity && (integrityMap[asset.name] = asset.integrity);
|
|
107
|
+
}), files = files.map((file)=>{
|
|
108
|
+
let normalizePath = (path)=>path.endsWith('/') ? path : `${path}/`, changes = {
|
|
109
|
+
name: basePath ? normalizePath(basePath) + file.name : file.name,
|
|
110
|
+
path: publicPath ? normalizePath(publicPath) + file.path : file.path
|
|
111
|
+
};
|
|
112
|
+
return integrityMap[file.path] && (changes.integrity = integrityMap[file.path]), changes.name = removeKeyHash ? changes.name.replace(removeKeyHash, '') : changes.name, Object.assign(file, changes);
|
|
113
|
+
}), files = (0, helpers_1.transformFiles)(files, options);
|
|
114
|
+
let manifest = (0, helpers_1.generateManifest)(compilation, files, options), isLastEmit = 0 === emitCount;
|
|
115
|
+
if (manifest = getCompilerHooks(compiler).beforeEmit.call(manifest), isLastEmit) {
|
|
116
|
+
let output = options.serialize(manifest);
|
|
117
|
+
compilation.emitAsset(manifestAssetId, new compiler.webpack.sources.RawSource(output)), options.writeToFileEmit && ((0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(manifestFileName), {
|
|
118
|
+
recursive: !0
|
|
119
|
+
}), (0, node_fs_1.writeFileSync)(manifestFileName, output));
|
|
120
|
+
}
|
|
121
|
+
getCompilerHooks(compiler).afterEmit.call(manifest);
|
|
122
|
+
}, exports.normalModuleLoaderHook = ({ moduleAssets }, context, module)=>{
|
|
123
|
+
let { emitFile } = context;
|
|
124
|
+
context.emitFile = (file, content, sourceMap)=>(module.userRequest && !moduleAssets[file] && Object.assign(moduleAssets, {
|
|
125
|
+
[file]: (0, node_path_1.join)((0, node_path_1.dirname)(file), (0, node_path_1.basename)(module.userRequest))
|
|
126
|
+
}), emitFile.call(module, file, content, sourceMap));
|
|
127
|
+
};
|
|
128
|
+
},
|
|
129
|
+
"../../node_modules/.pnpm/rspack-manifest-plugin@5.2.0_@rspack+core@1.7.2_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/index.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
130
|
+
exports.RspackManifestPlugin = void 0;
|
|
131
|
+
let node_path_1 = __webpack_require__("node:path"), hooks_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.0_@rspack+core@1.7.2_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/hooks.js"), emitCountMap = new Map(), defaults = {
|
|
132
|
+
assetHookStage: 1 / 0,
|
|
133
|
+
basePath: '',
|
|
134
|
+
fileName: 'manifest.json',
|
|
135
|
+
filter: null,
|
|
136
|
+
generate: void 0,
|
|
137
|
+
map: null,
|
|
138
|
+
publicPath: null,
|
|
139
|
+
removeKeyHash: /([a-f0-9]{16,32}\.?)/gi,
|
|
140
|
+
seed: void 0,
|
|
141
|
+
serialize: (manifest)=>JSON.stringify(manifest, null, 2),
|
|
142
|
+
sort: null,
|
|
143
|
+
transformExtensions: /^(gz|map)$/i,
|
|
144
|
+
useEntryKeys: !1,
|
|
145
|
+
useLegacyEmit: !1,
|
|
146
|
+
writeToFileEmit: !1
|
|
147
|
+
};
|
|
148
|
+
exports.RspackManifestPlugin = class {
|
|
149
|
+
constructor(opts){
|
|
150
|
+
this.options = Object.assign({}, defaults, opts);
|
|
151
|
+
}
|
|
152
|
+
apply(compiler) {
|
|
153
|
+
var _a, _b;
|
|
154
|
+
let manifestFileName = (0, node_path_1.resolve)((null == (_a = compiler.options.output) ? void 0 : _a.path) || './', this.options.fileName), manifestAssetId = (0, node_path_1.relative)((null == (_b = compiler.options.output) ? void 0 : _b.path) || './', manifestFileName), beforeRun = hooks_1.beforeRunHook.bind(this, {
|
|
155
|
+
emitCountMap,
|
|
156
|
+
manifestFileName
|
|
157
|
+
}), emit = hooks_1.emitHook.bind(this, {
|
|
158
|
+
compiler,
|
|
159
|
+
emitCountMap,
|
|
160
|
+
manifestAssetId,
|
|
161
|
+
manifestFileName,
|
|
162
|
+
moduleAssets: {},
|
|
163
|
+
options: this.options
|
|
164
|
+
}), hookOptions = {
|
|
165
|
+
name: 'WebpackManifestPlugin',
|
|
166
|
+
stage: this.options.assetHookStage
|
|
167
|
+
};
|
|
168
|
+
!0 === this.options.useLegacyEmit ? compiler.hooks.emit.tap(hookOptions, emit) : compiler.hooks.thisCompilation.tap(hookOptions, (compilation)=>{
|
|
169
|
+
compilation.hooks.processAssets.tap(hookOptions, ()=>emit(compilation));
|
|
170
|
+
}), compiler.hooks.run.tapAsync(hookOptions, beforeRun), compiler.hooks.watchRun.tapAsync(hookOptions, beforeRun);
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
},
|
|
174
|
+
"@rspack/lite-tapable" (module) {
|
|
175
|
+
module.exports = __rspack_external__rspack_lite_tapable_c6bdf810;
|
|
176
|
+
}
|
|
177
|
+
});
|