@lynx-js/rspeedy-canary 0.13.0-canary-20260105-ec1caf1a → 0.13.0-canary-20260105-03ea61ec
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/CHANGELOG.md +1 -1
- package/dist/{0~vendors-node_modules_pnpm_ipaddr_js_2_3_0_node_modules_ipaddr_js_lib_ipaddr_js.js → 0~node_modules_pnpm_ipaddr_js_2_3_0_node_modules_ipaddr_js_lib_ipaddr_js.js} +3 -6
- package/dist/0~src_cli_exit_ts.js +98 -108
- package/dist/0~src_config_output_dist-path_ts.js +2 -0
- package/dist/0~src_config_validate_ts.js +41917 -41925
- package/dist/0~src_plugins_api_plugin_ts.js +21 -31
- package/dist/0~src_plugins_chunkLoading_plugin_ts.js +10 -20
- package/dist/0~src_plugins_dev_plugin_ts.js +168 -179
- package/dist/0~src_plugins_emitOnErrors_plugin_ts.js +10 -20
- package/dist/0~src_plugins_index_ts.js +63 -51
- package/dist/0~src_plugins_inspect_plugin_ts.js +434 -39
- package/dist/0~src_plugins_minify_plugin_ts.js +66 -76
- package/dist/0~src_plugins_optimization_plugin_ts.js +14 -24
- package/dist/0~src_plugins_output_plugin_ts.js +29 -45
- package/dist/0~src_plugins_resolve_plugin_ts.js +10 -20
- package/dist/0~src_plugins_rsdoctor_plugin_ts.js +39 -49
- package/dist/0~src_plugins_sourcemap_plugin_ts.js +86 -96
- package/dist/0~src_plugins_swc_plugin_ts.js +20 -38
- package/dist/0~src_plugins_target_plugin_ts.js +21 -39
- package/dist/0~src_utils_getESVersionTarget_ts.js +4 -0
- package/dist/1~node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js.js +1422 -0
- package/dist/{1~vendors-node_modules_pnpm_commander_13_1_0_node_modules_commander_esm_mjs.js → 1~node_modules_pnpm_commander_13_1_0_node_modules_commander_esm_mjs.js} +17 -24
- package/dist/{1~vendors-node_modules_pnpm_ipaddr_js_2_3_0_node_modules_ipaddr_js_lib_ipaddr_js.js → 1~node_modules_pnpm_ipaddr_js_2_3_0_node_modules_ipaddr_js_lib_ipaddr_js.js} +3 -6
- package/dist/1~src_cli_build_ts.js +35 -424
- package/dist/1~src_cli_commands_ts.js +56 -74
- package/dist/1~src_cli_dev_ts.js +29 -410
- package/dist/1~src_cli_init_ts-src_create-rspeedy_ts.js +318 -0
- package/dist/1~src_cli_inspect_ts.js +18 -356
- package/dist/1~src_cli_preview_ts.js +23 -359
- package/dist/1~src_cli_watch_ts.js +39 -0
- package/dist/1~src_config_output_dist-path_ts.js +2 -0
- package/dist/1~src_config_validate_ts.js +41917 -41925
- package/dist/1~src_plugins_api_plugin_ts.js +22 -31
- package/dist/1~src_plugins_chunkLoading_plugin_ts.js +10 -20
- package/dist/1~src_plugins_dev_plugin_ts.js +170 -179
- package/dist/1~src_plugins_emitOnErrors_plugin_ts.js +10 -20
- package/dist/1~src_plugins_index_ts.js +63 -51
- package/dist/1~src_plugins_inspect_plugin_ts.js +436 -39
- package/dist/1~src_plugins_minify_plugin_ts.js +66 -76
- package/dist/1~src_plugins_optimization_plugin_ts.js +14 -24
- package/dist/1~src_plugins_output_plugin_ts.js +29 -45
- package/dist/1~src_plugins_resolve_plugin_ts.js +10 -20
- package/dist/1~src_plugins_rsdoctor_plugin_ts.js +37 -55
- package/dist/1~src_plugins_sourcemap_plugin_ts.js +86 -96
- package/dist/1~src_plugins_swc_plugin_ts.js +20 -38
- package/dist/1~src_plugins_target_plugin_ts.js +21 -39
- package/dist/1~src_utils_getESVersionTarget_ts.js +4 -0
- package/dist/1~src_utils_is-ci_ts.js +4 -0
- package/dist/1~src_version_ts.js +6 -18
- package/dist/cli/main.js +1 -357
- package/dist/cli/start.js +16 -130
- package/dist/index.js +1 -524
- package/dist/node_fs.js +7 -0
- package/dist/node_path.js +7 -0
- package/dist/node_url.js +1 -0
- package/dist/rslib-runtime.js +75 -0
- package/dist/src_cli_main_ts.js +149 -0
- package/dist/src_debug_ts.js +93 -0
- package/dist/src_index_ts.js +381 -0
- package/package.json +1 -1
- package/dist/0~vendors-node_modules_pnpm_javascript-stringify_2_1_0_node_modules_javascript-stringify_dist_i-562fbc.js +0 -417
- package/dist/1~events-fs-fs_promises-os-path-stream.js +0 -30
- package/dist/1~node_child_process-node_events-node_fs-node_path.js +0 -22
- package/dist/1~vendors-node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js.js +0 -1432
- package/dist/1~vendors-node_modules_pnpm_javascript-stringify_2_1_0_node_modules_javascript-stringify_dist_i-562fbc.js +0 -417
- /package/dist/{1~vendors-node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js.js.LICENSE.txt → 1~node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js.js.LICENSE.txt} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,524 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import * as __rspack_external_node_path_c5b9b54f from "node:path";
|
|
3
|
-
import node_fs from "node:fs";
|
|
4
|
-
import { pathToFileURL } from "node:url";
|
|
5
|
-
import { register } from "#register";
|
|
6
|
-
var __webpack_modules__ = {
|
|
7
|
-
"../../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js" (module) {
|
|
8
|
-
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
9
|
-
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || "win32" === p.platform || (p.stdout || {}).isTTY && "dumb" !== env.TERM || !!env.CI);
|
|
10
|
-
let formatter = (open, close, replace = open)=>(input)=>{
|
|
11
|
-
let string = "" + input, index = string.indexOf(close, open.length);
|
|
12
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
13
|
-
};
|
|
14
|
-
let replaceClose = (string, close, replace, index)=>{
|
|
15
|
-
let result = "", cursor = 0;
|
|
16
|
-
do {
|
|
17
|
-
result += string.substring(cursor, index) + replace;
|
|
18
|
-
cursor = index + close.length;
|
|
19
|
-
index = string.indexOf(close, cursor);
|
|
20
|
-
}while (~index);
|
|
21
|
-
return result + string.substring(cursor);
|
|
22
|
-
};
|
|
23
|
-
let createColors = (enabled = isColorSupported)=>{
|
|
24
|
-
let f = enabled ? formatter : ()=>String;
|
|
25
|
-
return {
|
|
26
|
-
isColorSupported: enabled,
|
|
27
|
-
reset: f("\x1b[0m", "\x1b[0m"),
|
|
28
|
-
bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
|
|
29
|
-
dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
|
|
30
|
-
italic: f("\x1b[3m", "\x1b[23m"),
|
|
31
|
-
underline: f("\x1b[4m", "\x1b[24m"),
|
|
32
|
-
inverse: f("\x1b[7m", "\x1b[27m"),
|
|
33
|
-
hidden: f("\x1b[8m", "\x1b[28m"),
|
|
34
|
-
strikethrough: f("\x1b[9m", "\x1b[29m"),
|
|
35
|
-
black: f("\x1b[30m", "\x1b[39m"),
|
|
36
|
-
red: f("\x1b[31m", "\x1b[39m"),
|
|
37
|
-
green: f("\x1b[32m", "\x1b[39m"),
|
|
38
|
-
yellow: f("\x1b[33m", "\x1b[39m"),
|
|
39
|
-
blue: f("\x1b[34m", "\x1b[39m"),
|
|
40
|
-
magenta: f("\x1b[35m", "\x1b[39m"),
|
|
41
|
-
cyan: f("\x1b[36m", "\x1b[39m"),
|
|
42
|
-
white: f("\x1b[37m", "\x1b[39m"),
|
|
43
|
-
gray: f("\x1b[90m", "\x1b[39m"),
|
|
44
|
-
bgBlack: f("\x1b[40m", "\x1b[49m"),
|
|
45
|
-
bgRed: f("\x1b[41m", "\x1b[49m"),
|
|
46
|
-
bgGreen: f("\x1b[42m", "\x1b[49m"),
|
|
47
|
-
bgYellow: f("\x1b[43m", "\x1b[49m"),
|
|
48
|
-
bgBlue: f("\x1b[44m", "\x1b[49m"),
|
|
49
|
-
bgMagenta: f("\x1b[45m", "\x1b[49m"),
|
|
50
|
-
bgCyan: f("\x1b[46m", "\x1b[49m"),
|
|
51
|
-
bgWhite: f("\x1b[47m", "\x1b[49m"),
|
|
52
|
-
blackBright: f("\x1b[90m", "\x1b[39m"),
|
|
53
|
-
redBright: f("\x1b[91m", "\x1b[39m"),
|
|
54
|
-
greenBright: f("\x1b[92m", "\x1b[39m"),
|
|
55
|
-
yellowBright: f("\x1b[93m", "\x1b[39m"),
|
|
56
|
-
blueBright: f("\x1b[94m", "\x1b[39m"),
|
|
57
|
-
magentaBright: f("\x1b[95m", "\x1b[39m"),
|
|
58
|
-
cyanBright: f("\x1b[96m", "\x1b[39m"),
|
|
59
|
-
whiteBright: f("\x1b[97m", "\x1b[39m"),
|
|
60
|
-
bgBlackBright: f("\x1b[100m", "\x1b[49m"),
|
|
61
|
-
bgRedBright: f("\x1b[101m", "\x1b[49m"),
|
|
62
|
-
bgGreenBright: f("\x1b[102m", "\x1b[49m"),
|
|
63
|
-
bgYellowBright: f("\x1b[103m", "\x1b[49m"),
|
|
64
|
-
bgBlueBright: f("\x1b[104m", "\x1b[49m"),
|
|
65
|
-
bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
|
|
66
|
-
bgCyanBright: f("\x1b[106m", "\x1b[49m"),
|
|
67
|
-
bgWhiteBright: f("\x1b[107m", "\x1b[49m")
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
module.exports = createColors();
|
|
71
|
-
module.exports.createColors = createColors;
|
|
72
|
-
},
|
|
73
|
-
"./src/debug.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
74
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
75
|
-
Iv: ()=>debugList,
|
|
76
|
-
Yz: ()=>debug,
|
|
77
|
-
_o: ()=>isDebug
|
|
78
|
-
});
|
|
79
|
-
var _rsbuild_core__rspack_import_0 = __webpack_require__("@rsbuild/core");
|
|
80
|
-
var picocolors__rspack_import_1 = __webpack_require__("../../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
81
|
-
var picocolors__rspack_import_1_default = /*#__PURE__*/ __webpack_require__.n(picocolors__rspack_import_1);
|
|
82
|
-
const isDebug = ()=>{
|
|
83
|
-
if (!process.env['DEBUG']) return false;
|
|
84
|
-
const values = process.env['DEBUG'].toLocaleLowerCase().split(',');
|
|
85
|
-
return [
|
|
86
|
-
'rsbuild',
|
|
87
|
-
'rspeedy',
|
|
88
|
-
'*'
|
|
89
|
-
].some((key)=>values.includes(key));
|
|
90
|
-
};
|
|
91
|
-
const label = picocolors__rspack_import_1_default().bgCyan('lynx');
|
|
92
|
-
const debug = (message)=>{
|
|
93
|
-
if (isDebug()) {
|
|
94
|
-
const result = 'string' == typeof message ? message : message();
|
|
95
|
-
_rsbuild_core__rspack_import_0.logger.level = 'verbose';
|
|
96
|
-
_rsbuild_core__rspack_import_0.logger.debug(`${label} ${result}`);
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
const debugList = (prefix, messages)=>debug(()=>`${prefix} ${[
|
|
100
|
-
''
|
|
101
|
-
].concat(messages).join('\n - ')}`);
|
|
102
|
-
},
|
|
103
|
-
"./src/version.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
104
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
105
|
-
f3: ()=>rspackVersion,
|
|
106
|
-
rE: ()=>version,
|
|
107
|
-
y3: ()=>core_.version
|
|
108
|
-
});
|
|
109
|
-
var core_ = __webpack_require__("@rsbuild/core");
|
|
110
|
-
var package_namespaceObject = {
|
|
111
|
-
rE: "0.12.5"
|
|
112
|
-
};
|
|
113
|
-
const version = package_namespaceObject.rE;
|
|
114
|
-
const rspackVersion = core_.rspack.rspackVersion;
|
|
115
|
-
},
|
|
116
|
-
"@rsbuild/core" (module) {
|
|
117
|
-
module.exports = __rspack_external__rsbuild_core_1b356efc;
|
|
118
|
-
},
|
|
119
|
-
"node:path" (module) {
|
|
120
|
-
module.exports = __rspack_external_node_path_c5b9b54f;
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
var __webpack_module_cache__ = {};
|
|
124
|
-
function __webpack_require__(moduleId) {
|
|
125
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
126
|
-
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
127
|
-
var module = __webpack_module_cache__[moduleId] = {
|
|
128
|
-
exports: {}
|
|
129
|
-
};
|
|
130
|
-
__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
131
|
-
return module.exports;
|
|
132
|
-
}
|
|
133
|
-
__webpack_require__.m = __webpack_modules__;
|
|
134
|
-
(()=>{
|
|
135
|
-
__webpack_require__.n = (module)=>{
|
|
136
|
-
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
137
|
-
__webpack_require__.d(getter, {
|
|
138
|
-
a: getter
|
|
139
|
-
});
|
|
140
|
-
return getter;
|
|
141
|
-
};
|
|
142
|
-
})();
|
|
143
|
-
(()=>{
|
|
144
|
-
var getProto = Object.getPrototypeOf ? (obj)=>Object.getPrototypeOf(obj) : (obj)=>obj.__proto__;
|
|
145
|
-
var leafPrototypes;
|
|
146
|
-
__webpack_require__.t = function(value, mode) {
|
|
147
|
-
if (1 & mode) value = this(value);
|
|
148
|
-
if (8 & mode) return value;
|
|
149
|
-
if ('object' == typeof value && value) {
|
|
150
|
-
if (4 & mode && value.__esModule) return value;
|
|
151
|
-
if (16 & mode && 'function' == typeof value.then) return value;
|
|
152
|
-
}
|
|
153
|
-
var ns = Object.create(null);
|
|
154
|
-
__webpack_require__.r(ns);
|
|
155
|
-
var def = {};
|
|
156
|
-
leafPrototypes = leafPrototypes || [
|
|
157
|
-
null,
|
|
158
|
-
getProto({}),
|
|
159
|
-
getProto([]),
|
|
160
|
-
getProto(getProto)
|
|
161
|
-
];
|
|
162
|
-
for(var current = 2 & mode && value; ('object' == typeof current || 'function' == typeof current) && !~leafPrototypes.indexOf(current); current = getProto(current))Object.getOwnPropertyNames(current).forEach((key)=>{
|
|
163
|
-
def[key] = ()=>value[key];
|
|
164
|
-
});
|
|
165
|
-
def['default'] = ()=>value;
|
|
166
|
-
__webpack_require__.d(ns, def);
|
|
167
|
-
return ns;
|
|
168
|
-
};
|
|
169
|
-
})();
|
|
170
|
-
(()=>{
|
|
171
|
-
__webpack_require__.d = (exports, definition)=>{
|
|
172
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
173
|
-
enumerable: true,
|
|
174
|
-
get: definition[key]
|
|
175
|
-
});
|
|
176
|
-
};
|
|
177
|
-
})();
|
|
178
|
-
(()=>{
|
|
179
|
-
__webpack_require__.f = {};
|
|
180
|
-
__webpack_require__.e = (chunkId)=>Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key)=>{
|
|
181
|
-
__webpack_require__.f[key](chunkId, promises);
|
|
182
|
-
return promises;
|
|
183
|
-
}, []));
|
|
184
|
-
})();
|
|
185
|
-
(()=>{
|
|
186
|
-
__webpack_require__.u = (chunkId)=>"0~" + chunkId + ".js";
|
|
187
|
-
})();
|
|
188
|
-
(()=>{
|
|
189
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
190
|
-
})();
|
|
191
|
-
(()=>{
|
|
192
|
-
__webpack_require__.r = (exports)=>{
|
|
193
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
|
|
194
|
-
value: 'Module'
|
|
195
|
-
});
|
|
196
|
-
Object.defineProperty(exports, '__esModule', {
|
|
197
|
-
value: true
|
|
198
|
-
});
|
|
199
|
-
};
|
|
200
|
-
})();
|
|
201
|
-
(()=>{
|
|
202
|
-
var installedChunks = {
|
|
203
|
-
index: 0
|
|
204
|
-
};
|
|
205
|
-
var installChunk = (data)=>{
|
|
206
|
-
var __rspack_esm_ids = data.__rspack_esm_ids;
|
|
207
|
-
var __webpack_modules__ = data.__webpack_modules__;
|
|
208
|
-
var __rspack_esm_runtime = data.__rspack_esm_runtime;
|
|
209
|
-
var moduleId, chunkId, i = 0;
|
|
210
|
-
for(moduleId in __webpack_modules__)if (__webpack_require__.o(__webpack_modules__, moduleId)) __webpack_require__.m[moduleId] = __webpack_modules__[moduleId];
|
|
211
|
-
if (__rspack_esm_runtime) __rspack_esm_runtime(__webpack_require__);
|
|
212
|
-
for(; i < __rspack_esm_ids.length; i++){
|
|
213
|
-
chunkId = __rspack_esm_ids[i];
|
|
214
|
-
if (__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) installedChunks[chunkId][0]();
|
|
215
|
-
installedChunks[__rspack_esm_ids[i]] = 0;
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
__webpack_require__.f.j = function(chunkId, promises) {
|
|
219
|
-
var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : void 0;
|
|
220
|
-
if (0 !== installedChunkData) if (installedChunkData) promises.push(installedChunkData[1]);
|
|
221
|
-
else {
|
|
222
|
-
var promise = import("./" + __webpack_require__.u(chunkId)).then(installChunk, (e)=>{
|
|
223
|
-
if (0 !== installedChunks[chunkId]) installedChunks[chunkId] = void 0;
|
|
224
|
-
throw e;
|
|
225
|
-
});
|
|
226
|
-
var promise = Promise.race([
|
|
227
|
-
promise,
|
|
228
|
-
new Promise((resolve)=>{
|
|
229
|
-
installedChunkData = installedChunks[chunkId] = [
|
|
230
|
-
resolve
|
|
231
|
-
];
|
|
232
|
-
})
|
|
233
|
-
]);
|
|
234
|
-
promises.push(installedChunkData[1] = promise);
|
|
235
|
-
}
|
|
236
|
-
};
|
|
237
|
-
})();
|
|
238
|
-
var external_node_path_ = __webpack_require__("node:path");
|
|
239
|
-
var core_ = __webpack_require__("@rsbuild/core");
|
|
240
|
-
var debug = __webpack_require__("./src/debug.ts");
|
|
241
|
-
function applyDefaultRspeedyConfig(config) {
|
|
242
|
-
const enableChunkSplitting = config.performance?.chunkSplit?.strategy && config.performance?.chunkSplit?.strategy !== 'all-in-one';
|
|
243
|
-
return (0, core_.mergeRsbuildConfig)({
|
|
244
|
-
mode: (()=>{
|
|
245
|
-
if (config.mode) return config.mode;
|
|
246
|
-
const nodeEnv = process.env['NODE_ENV'];
|
|
247
|
-
return 'production' === nodeEnv || 'development' === nodeEnv ? nodeEnv : 'none';
|
|
248
|
-
})(),
|
|
249
|
-
output: {
|
|
250
|
-
filename: getFilename(config.output?.filename),
|
|
251
|
-
inlineScripts: !enableChunkSplitting,
|
|
252
|
-
cssModules: {
|
|
253
|
-
localIdentName: '[local]-[hash:base64:6]'
|
|
254
|
-
}
|
|
255
|
-
},
|
|
256
|
-
performance: {
|
|
257
|
-
profile: (0, debug._o)() ? true : void 0
|
|
258
|
-
},
|
|
259
|
-
tools: {
|
|
260
|
-
rsdoctor: {
|
|
261
|
-
experiments: {
|
|
262
|
-
enableNativePlugin: true
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
}, config);
|
|
267
|
-
}
|
|
268
|
-
const DEFAULT_FILENAME = '[name].[platform].bundle';
|
|
269
|
-
function getFilename(filename) {
|
|
270
|
-
if ('string' == typeof filename) return {
|
|
271
|
-
bundle: filename,
|
|
272
|
-
template: filename
|
|
273
|
-
};
|
|
274
|
-
const finalFilename = filename?.bundle ?? filename?.template ?? DEFAULT_FILENAME;
|
|
275
|
-
return {
|
|
276
|
-
bundle: finalFilename,
|
|
277
|
-
template: finalFilename
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
const DEFAULT_ENTRY = './src/index.js';
|
|
281
|
-
function toRsbuildEntry(entry) {
|
|
282
|
-
if (void 0 === entry) {
|
|
283
|
-
(0, debug.Yz)(`Using default entry ${DEFAULT_ENTRY}`);
|
|
284
|
-
return {
|
|
285
|
-
main: DEFAULT_ENTRY
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
if (Array.isArray(entry) || 'string' == typeof entry) {
|
|
289
|
-
(0, debug.Yz)(()=>`Using single entry ${[
|
|
290
|
-
''
|
|
291
|
-
].concat(entry).join('\n - ')}`);
|
|
292
|
-
return {
|
|
293
|
-
main: entry
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
return Object.fromEntries(Object.entries(entry).map(([key, value])=>{
|
|
297
|
-
if (Array.isArray(value) || 'string' == typeof value) {
|
|
298
|
-
(0, debug.Iv)(`Using multiple entries - ${key}`, value);
|
|
299
|
-
return [
|
|
300
|
-
key,
|
|
301
|
-
{
|
|
302
|
-
import: value
|
|
303
|
-
}
|
|
304
|
-
];
|
|
305
|
-
}
|
|
306
|
-
(0, debug.Iv)(`Using multiple entries - ${key}`, value.import ?? DEFAULT_ENTRY);
|
|
307
|
-
if (void 0 === value.import) return [
|
|
308
|
-
key,
|
|
309
|
-
{
|
|
310
|
-
...value,
|
|
311
|
-
import: DEFAULT_ENTRY
|
|
312
|
-
}
|
|
313
|
-
];
|
|
314
|
-
return [
|
|
315
|
-
key,
|
|
316
|
-
value
|
|
317
|
-
];
|
|
318
|
-
}));
|
|
319
|
-
}
|
|
320
|
-
const defaultDataUriLimit = 2048;
|
|
321
|
-
function toRsbuildConfig(config) {
|
|
322
|
-
return {
|
|
323
|
-
dev: {
|
|
324
|
-
hmr: config.dev?.hmr ?? true,
|
|
325
|
-
lazyCompilation: false,
|
|
326
|
-
liveReload: config.dev?.liveReload ?? true,
|
|
327
|
-
watchFiles: config.dev?.watchFiles,
|
|
328
|
-
writeToDisk: config.dev?.writeToDisk ?? true,
|
|
329
|
-
progressBar: config.dev?.progressBar ?? true
|
|
330
|
-
},
|
|
331
|
-
environments: config.environments ?? {
|
|
332
|
-
lynx: {}
|
|
333
|
-
},
|
|
334
|
-
mode: config.mode,
|
|
335
|
-
output: {
|
|
336
|
-
assetPrefix: config.output?.assetPrefix,
|
|
337
|
-
charset: 'utf8',
|
|
338
|
-
cleanDistPath: config.output?.cleanDistPath,
|
|
339
|
-
copy: config.output?.copy,
|
|
340
|
-
cssModules: config.output?.cssModules,
|
|
341
|
-
dataUriLimit: config.output?.dataUriLimit ?? defaultDataUriLimit,
|
|
342
|
-
distPath: config.output?.distPath,
|
|
343
|
-
filenameHash: config.output?.filenameHash,
|
|
344
|
-
inlineScripts: config.output?.inlineScripts,
|
|
345
|
-
legalComments: config.output?.legalComments ?? 'none',
|
|
346
|
-
polyfill: 'off',
|
|
347
|
-
sourceMap: config.output?.sourceMap
|
|
348
|
-
},
|
|
349
|
-
resolve: {
|
|
350
|
-
alias: config.resolve?.alias,
|
|
351
|
-
aliasStrategy: config.resolve?.aliasStrategy,
|
|
352
|
-
dedupe: config.resolve?.dedupe,
|
|
353
|
-
extensions: config.resolve?.extensions
|
|
354
|
-
},
|
|
355
|
-
source: {
|
|
356
|
-
alias: config.source?.alias,
|
|
357
|
-
assetsInclude: config.source?.assetsInclude,
|
|
358
|
-
decorators: config.source?.decorators,
|
|
359
|
-
define: config.source?.define,
|
|
360
|
-
entry: toRsbuildEntry(config.source?.entry),
|
|
361
|
-
exclude: config.source?.exclude,
|
|
362
|
-
include: config.source?.include,
|
|
363
|
-
preEntry: config.source?.preEntry,
|
|
364
|
-
transformImport: config.source?.transformImport,
|
|
365
|
-
tsconfigPath: config.source?.tsconfigPath
|
|
366
|
-
},
|
|
367
|
-
server: {
|
|
368
|
-
base: config.server?.base,
|
|
369
|
-
compress: config.server?.compress,
|
|
370
|
-
cors: config.server?.cors,
|
|
371
|
-
headers: config.server?.headers,
|
|
372
|
-
host: config.server?.host,
|
|
373
|
-
port: config.server?.port,
|
|
374
|
-
proxy: config.server?.proxy,
|
|
375
|
-
strictPort: config.server?.strictPort
|
|
376
|
-
},
|
|
377
|
-
plugins: config.plugins,
|
|
378
|
-
performance: {
|
|
379
|
-
buildCache: config.performance?.buildCache,
|
|
380
|
-
chunkSplit: config.performance?.chunkSplit,
|
|
381
|
-
profile: config.performance?.profile,
|
|
382
|
-
removeConsole: toRsbuildRemoveConsole(config),
|
|
383
|
-
printFileSize: config.performance?.printFileSize ?? true
|
|
384
|
-
},
|
|
385
|
-
tools: {
|
|
386
|
-
bundlerChain: config.tools?.bundlerChain,
|
|
387
|
-
cssExtract: config.tools?.cssExtract,
|
|
388
|
-
cssLoader: config.tools?.cssLoader,
|
|
389
|
-
htmlPlugin: false,
|
|
390
|
-
rspack: config.tools?.rspack,
|
|
391
|
-
swc: config.tools?.swc
|
|
392
|
-
}
|
|
393
|
-
};
|
|
394
|
-
}
|
|
395
|
-
function toRsbuildRemoveConsole(config) {
|
|
396
|
-
if (config.performance?.removeConsole === true) return [
|
|
397
|
-
'log',
|
|
398
|
-
'warn',
|
|
399
|
-
'error',
|
|
400
|
-
'info',
|
|
401
|
-
'debug',
|
|
402
|
-
'profile',
|
|
403
|
-
'profileEnd'
|
|
404
|
-
];
|
|
405
|
-
return config.performance?.removeConsole;
|
|
406
|
-
}
|
|
407
|
-
async function createRspeedy({ cwd = process.cwd(), rspeedyConfig = {}, loadEnv = true, environment = [], callerName = 'rspeedy' }) {
|
|
408
|
-
const config = applyDefaultRspeedyConfig(rspeedyConfig);
|
|
409
|
-
const [rspeedy, { applyDefaultPlugins }] = await Promise.all([
|
|
410
|
-
(0, core_.createRsbuild)({
|
|
411
|
-
cwd,
|
|
412
|
-
loadEnv,
|
|
413
|
-
rsbuildConfig: toRsbuildConfig(config),
|
|
414
|
-
environment,
|
|
415
|
-
callerName
|
|
416
|
-
}),
|
|
417
|
-
__webpack_require__.e("src_plugins_index_ts").then(__webpack_require__.bind(__webpack_require__, "./src/plugins/index.ts"))
|
|
418
|
-
]);
|
|
419
|
-
await applyDefaultPlugins(rspeedy, config);
|
|
420
|
-
const inspectConfig = rspeedy.inspectConfig.bind(rspeedy);
|
|
421
|
-
return Object.assign(rspeedy, {
|
|
422
|
-
getRspeedyConfig: ()=>config,
|
|
423
|
-
async inspectConfig (options) {
|
|
424
|
-
const result = await inspectConfig(options);
|
|
425
|
-
const { inspectRspeedyConfig } = await Promise.all([
|
|
426
|
-
__webpack_require__.e("vendors-node_modules_pnpm_javascript-stringify_2_1_0_node_modules_javascript-stringify_dist_i-562fbc"),
|
|
427
|
-
__webpack_require__.e("src_plugins_inspect_plugin_ts")
|
|
428
|
-
]).then(__webpack_require__.bind(__webpack_require__, "./src/plugins/inspect.plugin.ts"));
|
|
429
|
-
await inspectRspeedyConfig(rspeedyConfig, external_node_path_["default"].resolve(options.outputPath ?? rspeedy.context.distPath, '.rsbuild/rspeedy.config.js'), options.verbose ?? false);
|
|
430
|
-
return result;
|
|
431
|
-
}
|
|
432
|
-
});
|
|
433
|
-
}
|
|
434
|
-
function mergeRspeedyConfig(...configs) {
|
|
435
|
-
return (0, core_.mergeRsbuildConfig)(...configs);
|
|
436
|
-
}
|
|
437
|
-
function defineConfig(config) {
|
|
438
|
-
return config;
|
|
439
|
-
}
|
|
440
|
-
var picocolors = __webpack_require__("../../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
441
|
-
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
442
|
-
const resolveConfigPath = (root, customConfig)=>{
|
|
443
|
-
if (customConfig) {
|
|
444
|
-
(0, debug.Yz)(`load custom config file ${customConfig} from ${root}`);
|
|
445
|
-
const customConfigPath = (0, external_node_path_.isAbsolute)(customConfig) ? customConfig : (0, external_node_path_.join)(root, customConfig);
|
|
446
|
-
if (node_fs.existsSync(customConfigPath)) return customConfigPath;
|
|
447
|
-
throw new Error(`Cannot find config file: ${picocolors_default().dim(customConfigPath)}`);
|
|
448
|
-
}
|
|
449
|
-
const CONFIG_FILES = [
|
|
450
|
-
'lynx.config.ts',
|
|
451
|
-
'lynx.config.js',
|
|
452
|
-
'lynx.config.mts',
|
|
453
|
-
'lynx.config.mjs'
|
|
454
|
-
];
|
|
455
|
-
for (const file of CONFIG_FILES){
|
|
456
|
-
(0, debug.Yz)(`load default config file ${file} from ${root}`);
|
|
457
|
-
const configFile = (0, external_node_path_.join)(root, file);
|
|
458
|
-
if (node_fs.existsSync(configFile)) {
|
|
459
|
-
(0, debug.Yz)(`default config ${configFile} found`);
|
|
460
|
-
return configFile;
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
throw new Error([
|
|
464
|
-
`Cannot find the default config file: ${picocolors_default().dim((0, external_node_path_.join)(root, CONFIG_FILES[0]))}.`,
|
|
465
|
-
`Use custom config with ${picocolors_default().green('`--config <config>`')} options.`
|
|
466
|
-
].join(' '));
|
|
467
|
-
};
|
|
468
|
-
async function loadConfig(loadConfigOptions) {
|
|
469
|
-
let { configPath } = loadConfigOptions;
|
|
470
|
-
if (!configPath || !(0, external_node_path_.isAbsolute)(configPath)) configPath = resolveConfigPath(loadConfigOptions.cwd ?? process.cwd(), configPath);
|
|
471
|
-
const specifier = pathToFileURL(configPath).toString();
|
|
472
|
-
let unregister;
|
|
473
|
-
unregister = shouldUseNativeImport(configPath) ? ()=>{} : register({
|
|
474
|
-
load: !hasNativeTSSupport(),
|
|
475
|
-
resolve: true
|
|
476
|
-
});
|
|
477
|
-
try {
|
|
478
|
-
const [exports, { validate }] = await Promise.all([
|
|
479
|
-
import(`${specifier}?t=${Date.now()}`),
|
|
480
|
-
__webpack_require__.e("src_config_validate_ts").then(__webpack_require__.bind(__webpack_require__, "./src/config/validate.ts"))
|
|
481
|
-
]);
|
|
482
|
-
const configExport = 'default' in exports ? exports.default : exports;
|
|
483
|
-
const rawContent = 'function' == typeof configExport ? await configExport({
|
|
484
|
-
command: process.argv[2] ?? 'build',
|
|
485
|
-
env: process.env['NODE_ENV'] ?? 'production'
|
|
486
|
-
}) : await configExport;
|
|
487
|
-
return {
|
|
488
|
-
configPath,
|
|
489
|
-
content: validate(rawContent, configPath)
|
|
490
|
-
};
|
|
491
|
-
} finally{
|
|
492
|
-
unregister();
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
function shouldUseNativeImport(configPath) {
|
|
496
|
-
return isJavaScriptPath(configPath) || isDeno();
|
|
497
|
-
}
|
|
498
|
-
function hasNativeTSSupport() {
|
|
499
|
-
if (isDeno()) return true;
|
|
500
|
-
if (process.features.typescript) return true;
|
|
501
|
-
if (false === process.features.typescript) return false;
|
|
502
|
-
const { NODE_OPTIONS } = process.env;
|
|
503
|
-
if (!NODE_OPTIONS) return false;
|
|
504
|
-
return NODE_OPTIONS.includes('--experimental-transform-types') || NODE_OPTIONS.includes('--experimental-strip-types');
|
|
505
|
-
}
|
|
506
|
-
function isJavaScriptPath(configPath) {
|
|
507
|
-
const ext = (0, external_node_path_.extname)(configPath);
|
|
508
|
-
return [
|
|
509
|
-
'.js',
|
|
510
|
-
'.mjs',
|
|
511
|
-
'.cjs'
|
|
512
|
-
].includes(ext);
|
|
513
|
-
}
|
|
514
|
-
function isDeno() {
|
|
515
|
-
if ("u" > typeof Deno || process.versions?.deno) return true;
|
|
516
|
-
return false;
|
|
517
|
-
}
|
|
518
|
-
var version = __webpack_require__("./src/version.ts");
|
|
519
|
-
var __webpack_exports__logger = core_.logger;
|
|
520
|
-
var __webpack_exports__rsbuildVersion = version.y3;
|
|
521
|
-
var __webpack_exports__rspack = core_.rspack;
|
|
522
|
-
var __webpack_exports__rspackVersion = version.f3;
|
|
523
|
-
var __webpack_exports__version = version.rE;
|
|
524
|
-
export { createRspeedy, defineConfig, loadConfig, mergeRspeedyConfig, __webpack_exports__logger as logger, __webpack_exports__rsbuildVersion as rsbuildVersion, __webpack_exports__rspack as rspack, __webpack_exports__rspackVersion as rspackVersion, __webpack_exports__version as version };
|
|
1
|
+
export { createRspeedy, defineConfig, loadConfig, logger, mergeRspeedyConfig, rsbuildVersion, rspack, rspackVersion, version } from "./src_index_ts.js";
|
package/dist/node_fs.js
ADDED
package/dist/node_url.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { pathToFileURL } from "node:url";
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
var __webpack_modules__ = {};
|
|
2
|
+
var __webpack_module_cache__ = {};
|
|
3
|
+
function __webpack_require__(moduleId) {
|
|
4
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
5
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
6
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
7
|
+
exports: {}
|
|
8
|
+
};
|
|
9
|
+
__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
10
|
+
return module.exports;
|
|
11
|
+
}
|
|
12
|
+
__webpack_require__.m = __webpack_modules__;
|
|
13
|
+
(()=>{
|
|
14
|
+
__webpack_require__.add = function(modules) {
|
|
15
|
+
Object.assign(__webpack_require__.m, modules);
|
|
16
|
+
};
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.n = (module)=>{
|
|
20
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
21
|
+
__webpack_require__.d(getter, {
|
|
22
|
+
a: getter
|
|
23
|
+
});
|
|
24
|
+
return getter;
|
|
25
|
+
};
|
|
26
|
+
})();
|
|
27
|
+
(()=>{
|
|
28
|
+
var getProto = Object.getPrototypeOf ? (obj)=>Object.getPrototypeOf(obj) : (obj)=>obj.__proto__;
|
|
29
|
+
var leafPrototypes;
|
|
30
|
+
__webpack_require__.t = function(value, mode) {
|
|
31
|
+
if (1 & mode) value = this(value);
|
|
32
|
+
if (8 & mode) return value;
|
|
33
|
+
if ('object' == typeof value && value) {
|
|
34
|
+
if (4 & mode && value.__esModule) return value;
|
|
35
|
+
if (16 & mode && 'function' == typeof value.then) return value;
|
|
36
|
+
}
|
|
37
|
+
var ns = Object.create(null);
|
|
38
|
+
__webpack_require__.r(ns);
|
|
39
|
+
var def = {};
|
|
40
|
+
leafPrototypes = leafPrototypes || [
|
|
41
|
+
null,
|
|
42
|
+
getProto({}),
|
|
43
|
+
getProto([]),
|
|
44
|
+
getProto(getProto)
|
|
45
|
+
];
|
|
46
|
+
for(var current = 2 & mode && value; ('object' == typeof current || 'function' == typeof current) && !~leafPrototypes.indexOf(current); current = getProto(current))Object.getOwnPropertyNames(current).forEach((key)=>{
|
|
47
|
+
def[key] = ()=>value[key];
|
|
48
|
+
});
|
|
49
|
+
def['default'] = ()=>value;
|
|
50
|
+
__webpack_require__.d(ns, def);
|
|
51
|
+
return ns;
|
|
52
|
+
};
|
|
53
|
+
})();
|
|
54
|
+
(()=>{
|
|
55
|
+
__webpack_require__.d = (exports, definition)=>{
|
|
56
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: definition[key]
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
})();
|
|
62
|
+
(()=>{
|
|
63
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
64
|
+
})();
|
|
65
|
+
(()=>{
|
|
66
|
+
__webpack_require__.r = (exports)=>{
|
|
67
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
|
|
68
|
+
value: 'Module'
|
|
69
|
+
});
|
|
70
|
+
Object.defineProperty(exports, '__esModule', {
|
|
71
|
+
value: true
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
})();
|
|
75
|
+
export { __webpack_require__ };
|