@lynx-js/rspeedy 0.11.2 → 0.11.4

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.
Files changed (52) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/{src_config_validate_ts.js → 0~src_config_validate_ts.js} +1825 -1558
  3. package/dist/0~src_plugins_api_plugin_ts.js +32 -0
  4. package/dist/0~src_plugins_chunkLoading_plugin_ts.js +23 -0
  5. package/dist/{src_plugins_dev_plugin_ts.js → 0~src_plugins_dev_plugin_ts.js} +13 -8
  6. package/dist/{src_plugins_emitOnErrors_plugin_ts.js → 0~src_plugins_emitOnErrors_plugin_ts.js} +0 -1
  7. package/dist/{src_plugins_inspect_plugin_ts.js → 0~src_plugins_inspect_plugin_ts.js} +0 -1
  8. package/dist/{src_plugins_minify_plugin_ts.js → 0~src_plugins_minify_plugin_ts.js} +0 -1
  9. package/dist/{src_plugins_optimization_plugin_ts.js → 0~src_plugins_optimization_plugin_ts.js} +0 -1
  10. package/dist/{src_plugins_output_plugin_ts.js → 0~src_plugins_output_plugin_ts.js} +0 -1
  11. package/dist/{src_plugins_resolve_plugin_ts.js → 0~src_plugins_resolve_plugin_ts.js} +0 -1
  12. package/dist/0~src_plugins_rsdoctor_plugin_ts.js +53 -0
  13. package/dist/{src_plugins_sourcemap_plugin_ts.js → 0~src_plugins_sourcemap_plugin_ts.js} +0 -1
  14. package/dist/{src_plugins_swc_plugin_ts.js → 0~src_plugins_swc_plugin_ts.js} +0 -1
  15. package/dist/{src_plugins_target_plugin_ts.js → 0~src_plugins_target_plugin_ts.js} +7 -14
  16. package/dist/{src_cli_build_ts.js → 1~src_cli_build_ts.js} +8 -3
  17. package/dist/{src_cli_commands_ts.js → 1~src_cli_commands_ts.js} +1 -1
  18. package/dist/{src_cli_dev_ts.js → 1~src_cli_dev_ts.js} +8 -3
  19. package/dist/{src_cli_inspect_ts.js → 1~src_cli_inspect_ts.js} +8 -3
  20. package/dist/{src_cli_preview_ts.js → 1~src_cli_preview_ts.js} +8 -3
  21. package/dist/1~src_config_validate_ts.js +41047 -0
  22. package/dist/{src_plugins_api_plugin_ts.js → 1~src_plugins_api_plugin_ts.js} +0 -1
  23. package/dist/1~src_plugins_chunkLoading_plugin_ts.js +23 -0
  24. package/dist/1~src_plugins_dev_plugin_ts.js +149 -0
  25. package/dist/1~src_plugins_emitOnErrors_plugin_ts.js +21 -0
  26. package/dist/1~src_plugins_index_ts.js +52 -0
  27. package/dist/1~src_plugins_inspect_plugin_ts.js +48 -0
  28. package/dist/1~src_plugins_minify_plugin_ts.js +85 -0
  29. package/dist/1~src_plugins_optimization_plugin_ts.js +25 -0
  30. package/dist/1~src_plugins_output_plugin_ts.js +46 -0
  31. package/dist/1~src_plugins_resolve_plugin_ts.js +21 -0
  32. package/dist/{src_plugins_rsdoctor_plugin_ts.js → 1~src_plugins_rsdoctor_plugin_ts.js} +0 -1
  33. package/dist/1~src_plugins_sourcemap_plugin_ts.js +99 -0
  34. package/dist/1~src_plugins_swc_plugin_ts.js +39 -0
  35. package/dist/1~src_plugins_target_plugin_ts.js +39 -0
  36. package/dist/{src_version_ts.js → 1~src_version_ts.js} +1 -1
  37. package/dist/{vendors-node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js.js → 1~vendors-node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js.js} +2 -6
  38. package/dist/1~vendors-node_modules_pnpm_ipaddr_js_2_2_0_node_modules_ipaddr_js_lib_ipaddr_js.js +1068 -0
  39. package/dist/1~vendors-node_modules_pnpm_javascript-stringify_2_1_0_node_modules_javascript-stringify_dist_i-562fbc.js +417 -0
  40. package/dist/cli/main.js +1 -1
  41. package/dist/index.d.ts +161 -0
  42. package/dist/index.js +10 -4
  43. package/package.json +3 -3
  44. package/dist/src_plugins_chunkLoading_plugin_ts.js +0 -37
  45. /package/dist/{src_cli_exit_ts.js → 0~src_cli_exit_ts.js} +0 -0
  46. /package/dist/{src_plugins_index_ts.js → 0~src_plugins_index_ts.js} +0 -0
  47. /package/dist/{vendors-node_modules_pnpm_ipaddr_js_2_2_0_node_modules_ipaddr_js_lib_ipaddr_js.js → 0~vendors-node_modules_pnpm_ipaddr_js_2_2_0_node_modules_ipaddr_js_lib_ipaddr_js.js} +0 -0
  48. /package/dist/{vendors-node_modules_pnpm_javascript-stringify_2_1_0_node_modules_javascript-stringify_dist_i-562fbc.js → 0~vendors-node_modules_pnpm_javascript-stringify_2_1_0_node_modules_javascript-stringify_dist_i-562fbc.js} +0 -0
  49. /package/dist/{events-fs-fs_promises-os-path-stream.js → 1~events-fs-fs_promises-os-path-stream.js} +0 -0
  50. /package/dist/{node_child_process-node_events-node_fs-node_path.js → 1~node_child_process-node_events-node_fs-node_path.js} +0 -0
  51. /package/dist/{vendors-node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js.js.LICENSE.txt → 1~vendors-node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js.js.LICENSE.txt} +0 -0
  52. /package/dist/{vendors-node_modules_pnpm_commander_13_1_0_node_modules_commander_esm_mjs.js → 1~vendors-node_modules_pnpm_commander_13_1_0_node_modules_commander_esm_mjs.js} +0 -0
@@ -0,0 +1,417 @@
1
+ export const __webpack_id__ = "vendors-node_modules_pnpm_javascript-stringify_2_1_0_node_modules_javascript-stringify_dist_i-562fbc";
2
+ export const __webpack_ids__ = [
3
+ "vendors-node_modules_pnpm_javascript-stringify_2_1_0_node_modules_javascript-stringify_dist_i-562fbc"
4
+ ];
5
+ export const __webpack_modules__ = {
6
+ "../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/array.js": function(__unused_webpack_module, exports) {
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.arrayToString = void 0;
11
+ const arrayToString = (array, space, next)=>{
12
+ const values = array.map(function(value, index) {
13
+ const result = next(value, index);
14
+ if (void 0 === result) return String(result);
15
+ return space + result.split("\n").join(`\n${space}`);
16
+ }).join(space ? ",\n" : ",");
17
+ const eol = space && values ? "\n" : "";
18
+ return `[${eol}${values}${eol}]`;
19
+ };
20
+ exports.arrayToString = arrayToString;
21
+ },
22
+ "../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/function.js": function(__unused_webpack_module, exports, __webpack_require__) {
23
+ Object.defineProperty(exports, "__esModule", {
24
+ value: true
25
+ });
26
+ exports.FunctionParser = exports.dedentFunction = exports.functionToString = exports.USED_METHOD_KEY = void 0;
27
+ const quote_1 = __webpack_require__("../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js");
28
+ const METHOD_NAMES_ARE_QUOTED = '"' === ({
29
+ " " () {}
30
+ })[" "].toString().charAt(0);
31
+ const FUNCTION_PREFIXES = {
32
+ Function: "function ",
33
+ GeneratorFunction: "function* ",
34
+ AsyncFunction: "async function ",
35
+ AsyncGeneratorFunction: "async function* "
36
+ };
37
+ const METHOD_PREFIXES = {
38
+ Function: "",
39
+ GeneratorFunction: "*",
40
+ AsyncFunction: "async ",
41
+ AsyncGeneratorFunction: "async *"
42
+ };
43
+ const TOKENS_PRECEDING_REGEXPS = new Set("case delete else in instanceof new return throw typeof void , ; : + - ! ~ & | ^ * / % < > ? =".split(" "));
44
+ exports.USED_METHOD_KEY = new WeakSet();
45
+ const functionToString = (fn, space, next, key)=>{
46
+ const name = "string" == typeof key ? key : void 0;
47
+ if (void 0 !== name) exports.USED_METHOD_KEY.add(fn);
48
+ return new FunctionParser(fn, space, next, name).stringify();
49
+ };
50
+ exports.functionToString = functionToString;
51
+ function dedentFunction(fnString) {
52
+ let found;
53
+ for (const line of fnString.split("\n").slice(1)){
54
+ const m = /^[\s\t]+/.exec(line);
55
+ if (!m) return fnString;
56
+ const [str] = m;
57
+ if (void 0 === found) found = str;
58
+ else if (str.length < found.length) found = str;
59
+ }
60
+ return found ? fnString.split(`\n${found}`).join("\n") : fnString;
61
+ }
62
+ exports.dedentFunction = dedentFunction;
63
+ class FunctionParser {
64
+ constructor(fn, indent, next, key){
65
+ this.fn = fn;
66
+ this.indent = indent;
67
+ this.next = next;
68
+ this.key = key;
69
+ this.pos = 0;
70
+ this.hadKeyword = false;
71
+ this.fnString = Function.prototype.toString.call(fn);
72
+ this.fnType = fn.constructor.name;
73
+ this.keyQuote = void 0 === key ? "" : quote_1.quoteKey(key, next);
74
+ this.keyPrefix = void 0 === key ? "" : `${this.keyQuote}:${indent ? " " : ""}`;
75
+ this.isMethodCandidate = void 0 === key ? false : "" === this.fn.name || this.fn.name === key;
76
+ }
77
+ stringify() {
78
+ const value = this.tryParse();
79
+ if (!value) return `${this.keyPrefix}void ${this.next(this.fnString)}`;
80
+ return dedentFunction(value);
81
+ }
82
+ getPrefix() {
83
+ if (this.isMethodCandidate && !this.hadKeyword) return METHOD_PREFIXES[this.fnType] + this.keyQuote;
84
+ return this.keyPrefix + FUNCTION_PREFIXES[this.fnType];
85
+ }
86
+ tryParse() {
87
+ if ("}" !== this.fnString[this.fnString.length - 1]) return this.keyPrefix + this.fnString;
88
+ if (this.fn.name) {
89
+ const result = this.tryStrippingName();
90
+ if (result) return result;
91
+ }
92
+ const prevPos = this.pos;
93
+ if ("class" === this.consumeSyntax()) return this.fnString;
94
+ this.pos = prevPos;
95
+ if (this.tryParsePrefixTokens()) {
96
+ const result = this.tryStrippingName();
97
+ if (result) return result;
98
+ let offset = this.pos;
99
+ switch(this.consumeSyntax("WORD_LIKE")){
100
+ case "WORD_LIKE":
101
+ if (this.isMethodCandidate && !this.hadKeyword) offset = this.pos;
102
+ case "()":
103
+ if ("=>" === this.fnString.substr(this.pos, 2)) return this.keyPrefix + this.fnString;
104
+ this.pos = offset;
105
+ case '"':
106
+ case "'":
107
+ case "[]":
108
+ return this.getPrefix() + this.fnString.substr(this.pos);
109
+ }
110
+ }
111
+ }
112
+ tryStrippingName() {
113
+ if (METHOD_NAMES_ARE_QUOTED) return;
114
+ let start = this.pos;
115
+ const prefix = this.fnString.substr(this.pos, this.fn.name.length);
116
+ if (prefix === this.fn.name) {
117
+ this.pos += prefix.length;
118
+ if ("()" === this.consumeSyntax() && "{}" === this.consumeSyntax() && this.pos === this.fnString.length) {
119
+ if (this.isMethodCandidate || !quote_1.isValidVariableName(prefix)) start += prefix.length;
120
+ return this.getPrefix() + this.fnString.substr(start);
121
+ }
122
+ }
123
+ this.pos = start;
124
+ }
125
+ tryParsePrefixTokens() {
126
+ let posPrev = this.pos;
127
+ this.hadKeyword = false;
128
+ switch(this.fnType){
129
+ case "AsyncFunction":
130
+ if ("async" !== this.consumeSyntax()) return false;
131
+ posPrev = this.pos;
132
+ case "Function":
133
+ if ("function" === this.consumeSyntax()) this.hadKeyword = true;
134
+ else this.pos = posPrev;
135
+ return true;
136
+ case "AsyncGeneratorFunction":
137
+ if ("async" !== this.consumeSyntax()) return false;
138
+ case "GeneratorFunction":
139
+ let token = this.consumeSyntax();
140
+ if ("function" === token) {
141
+ token = this.consumeSyntax();
142
+ this.hadKeyword = true;
143
+ }
144
+ return "*" === token;
145
+ }
146
+ }
147
+ consumeSyntax(wordLikeToken) {
148
+ const m = this.consumeMatch(/^(?:([A-Za-z_0-9$\xA0-\uFFFF]+)|=>|\+\+|\-\-|.)/);
149
+ if (!m) return;
150
+ const [token, match] = m;
151
+ this.consumeWhitespace();
152
+ if (match) return wordLikeToken || match;
153
+ switch(token){
154
+ case "(":
155
+ return this.consumeSyntaxUntil("(", ")");
156
+ case "[":
157
+ return this.consumeSyntaxUntil("[", "]");
158
+ case "{":
159
+ return this.consumeSyntaxUntil("{", "}");
160
+ case "`":
161
+ return this.consumeTemplate();
162
+ case '"':
163
+ return this.consumeRegExp(/^(?:[^\\"]|\\.)*"/, '"');
164
+ case "'":
165
+ return this.consumeRegExp(/^(?:[^\\']|\\.)*'/, "'");
166
+ }
167
+ return token;
168
+ }
169
+ consumeSyntaxUntil(startToken, endToken) {
170
+ let isRegExpAllowed = true;
171
+ for(;;){
172
+ const token = this.consumeSyntax();
173
+ if (token === endToken) return startToken + endToken;
174
+ if (!token || ")" === token || "]" === token || "}" === token) return;
175
+ if ("/" === token && isRegExpAllowed && this.consumeMatch(/^(?:\\.|[^\\\/\n[]|\[(?:\\.|[^\]])*\])+\/[a-z]*/)) {
176
+ isRegExpAllowed = false;
177
+ this.consumeWhitespace();
178
+ } else isRegExpAllowed = TOKENS_PRECEDING_REGEXPS.has(token);
179
+ }
180
+ }
181
+ consumeMatch(re) {
182
+ const m = re.exec(this.fnString.substr(this.pos));
183
+ if (m) this.pos += m[0].length;
184
+ return m;
185
+ }
186
+ consumeRegExp(re, token) {
187
+ const m = re.exec(this.fnString.substr(this.pos));
188
+ if (!m) return;
189
+ this.pos += m[0].length;
190
+ this.consumeWhitespace();
191
+ return token;
192
+ }
193
+ consumeTemplate() {
194
+ for(;;){
195
+ this.consumeMatch(/^(?:[^`$\\]|\\.|\$(?!{))*/);
196
+ if ("`" === this.fnString[this.pos]) {
197
+ this.pos++;
198
+ this.consumeWhitespace();
199
+ return "`";
200
+ }
201
+ if ("${" === this.fnString.substr(this.pos, 2)) {
202
+ this.pos += 2;
203
+ this.consumeWhitespace();
204
+ if (this.consumeSyntaxUntil("{", "}")) continue;
205
+ }
206
+ return;
207
+ }
208
+ }
209
+ consumeWhitespace() {
210
+ this.consumeMatch(/^(?:\s|\/\/.*|\/\*[^]*?\*\/)*/);
211
+ }
212
+ }
213
+ exports.FunctionParser = FunctionParser;
214
+ },
215
+ "../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/index.js": function(__unused_webpack_module, exports, __webpack_require__) {
216
+ exports.stringify = void 0;
217
+ const stringify_1 = __webpack_require__("../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/stringify.js");
218
+ const quote_1 = __webpack_require__("../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js");
219
+ const ROOT_SENTINEL = Symbol("root");
220
+ function stringify(value, replacer, indent, options = {}) {
221
+ const space = "string" == typeof indent ? indent : " ".repeat(indent || 0);
222
+ const path = [];
223
+ const stack = new Set();
224
+ const tracking = new Map();
225
+ const unpack = new Map();
226
+ let valueCount = 0;
227
+ const { maxDepth = 100, references = false, skipUndefinedProperties = false, maxValues = 100000 } = options;
228
+ const valueToString = replacerToString(replacer);
229
+ const onNext = (value, key)=>{
230
+ if (++valueCount > maxValues) return;
231
+ if (skipUndefinedProperties && void 0 === value) return;
232
+ if (path.length > maxDepth) return;
233
+ if (void 0 === key) return valueToString(value, space, onNext, key);
234
+ path.push(key);
235
+ const result = builder(value, key === ROOT_SENTINEL ? void 0 : key);
236
+ path.pop();
237
+ return result;
238
+ };
239
+ const builder = references ? (value, key)=>{
240
+ if (null !== value && ("object" == typeof value || "function" == typeof value || "symbol" == typeof value)) {
241
+ if (tracking.has(value)) {
242
+ unpack.set(path.slice(1), tracking.get(value));
243
+ return valueToString(void 0, space, onNext, key);
244
+ }
245
+ tracking.set(value, path.slice(1));
246
+ }
247
+ return valueToString(value, space, onNext, key);
248
+ } : (value, key)=>{
249
+ if (stack.has(value)) return;
250
+ stack.add(value);
251
+ const result = valueToString(value, space, onNext, key);
252
+ stack.delete(value);
253
+ return result;
254
+ };
255
+ const result = onNext(value, ROOT_SENTINEL);
256
+ if (unpack.size) {
257
+ const sp = space ? " " : "";
258
+ const eol = space ? "\n" : "";
259
+ let wrapper = `var x${sp}=${sp}${result};${eol}`;
260
+ for (const [key, value] of unpack.entries()){
261
+ const keyPath = quote_1.stringifyPath(key, onNext);
262
+ const valuePath = quote_1.stringifyPath(value, onNext);
263
+ wrapper += `x${keyPath}${sp}=${sp}x${valuePath};${eol}`;
264
+ }
265
+ return `(function${sp}()${sp}{${eol}${wrapper}return x;${eol}}())`;
266
+ }
267
+ return result;
268
+ }
269
+ exports.stringify = stringify;
270
+ function replacerToString(replacer) {
271
+ if (!replacer) return stringify_1.toString;
272
+ return (value, space, next, key)=>replacer(value, space, (value)=>stringify_1.toString(value, space, next, key), key);
273
+ }
274
+ },
275
+ "../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/object.js": function(__unused_webpack_module, exports, __webpack_require__) {
276
+ Object.defineProperty(exports, "__esModule", {
277
+ value: true
278
+ });
279
+ exports.objectToString = void 0;
280
+ const quote_1 = __webpack_require__("../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js");
281
+ const function_1 = __webpack_require__("../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/function.js");
282
+ const array_1 = __webpack_require__("../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/array.js");
283
+ const objectToString = (value, space, next, key)=>{
284
+ if ("function" == typeof Buffer && Buffer.isBuffer(value)) return `Buffer.from(${next(value.toString("base64"))}, 'base64')`;
285
+ if ("object" == typeof global && value === global) return globalToString(value, space, next, key);
286
+ const toString = OBJECT_TYPES[Object.prototype.toString.call(value)];
287
+ return toString ? toString(value, space, next, key) : void 0;
288
+ };
289
+ exports.objectToString = objectToString;
290
+ const rawObjectToString = (obj, indent, next, key)=>{
291
+ const eol = indent ? "\n" : "";
292
+ const space = indent ? " " : "";
293
+ const values = Object.keys(obj).reduce(function(values, key) {
294
+ const fn = obj[key];
295
+ const result = next(fn, key);
296
+ if (void 0 === result) return values;
297
+ const value = result.split("\n").join(`\n${indent}`);
298
+ if (function_1.USED_METHOD_KEY.has(fn)) {
299
+ values.push(`${indent}${value}`);
300
+ return values;
301
+ }
302
+ values.push(`${indent}${quote_1.quoteKey(key, next)}:${space}${value}`);
303
+ return values;
304
+ }, []).join(`,${eol}`);
305
+ if ("" === values) return "{}";
306
+ return `{${eol}${values}${eol}}`;
307
+ };
308
+ const globalToString = (value, space, next)=>`Function(${next("return this")})()`;
309
+ const OBJECT_TYPES = {
310
+ "[object Array]": array_1.arrayToString,
311
+ "[object Object]": rawObjectToString,
312
+ "[object Error]": (error, space, next)=>`new Error(${next(error.message)})`,
313
+ "[object Date]": (date)=>`new Date(${date.getTime()})`,
314
+ "[object String]": (str, space, next)=>`new String(${next(str.toString())})`,
315
+ "[object Number]": (num)=>`new Number(${num})`,
316
+ "[object Boolean]": (bool)=>`new Boolean(${bool})`,
317
+ "[object Set]": (set, space, next)=>`new Set(${next(Array.from(set))})`,
318
+ "[object Map]": (map, space, next)=>`new Map(${next(Array.from(map))})`,
319
+ "[object RegExp]": String,
320
+ "[object global]": globalToString,
321
+ "[object Window]": globalToString
322
+ };
323
+ },
324
+ "../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js": function(__unused_webpack_module, exports) {
325
+ Object.defineProperty(exports, "__esModule", {
326
+ value: true
327
+ });
328
+ exports.stringifyPath = exports.quoteKey = exports.isValidVariableName = exports.IS_VALID_IDENTIFIER = exports.quoteString = void 0;
329
+ const ESCAPABLE = /[\\\'\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
330
+ const META_CHARS = new Map([
331
+ [
332
+ "\b",
333
+ "\\b"
334
+ ],
335
+ [
336
+ "\t",
337
+ "\\t"
338
+ ],
339
+ [
340
+ "\n",
341
+ "\\n"
342
+ ],
343
+ [
344
+ "\f",
345
+ "\\f"
346
+ ],
347
+ [
348
+ "\r",
349
+ "\\r"
350
+ ],
351
+ [
352
+ "'",
353
+ "\\'"
354
+ ],
355
+ [
356
+ '"',
357
+ '\\"'
358
+ ],
359
+ [
360
+ "\\",
361
+ "\\\\"
362
+ ]
363
+ ]);
364
+ function escapeChar(char) {
365
+ return META_CHARS.get(char) || `\\u${`0000${char.charCodeAt(0).toString(16)}`.slice(-4)}`;
366
+ }
367
+ function quoteString(str) {
368
+ return `'${str.replace(ESCAPABLE, escapeChar)}'`;
369
+ }
370
+ exports.quoteString = quoteString;
371
+ const RESERVED_WORDS = new Set("break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "));
372
+ exports.IS_VALID_IDENTIFIER = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
373
+ function isValidVariableName(name) {
374
+ return "string" == typeof name && !RESERVED_WORDS.has(name) && exports.IS_VALID_IDENTIFIER.test(name);
375
+ }
376
+ exports.isValidVariableName = isValidVariableName;
377
+ function quoteKey(key, next) {
378
+ return isValidVariableName(key) ? key : next(key);
379
+ }
380
+ exports.quoteKey = quoteKey;
381
+ function stringifyPath(path, next) {
382
+ let result = "";
383
+ for (const key of path)if (isValidVariableName(key)) result += `.${key}`;
384
+ else result += `[${next(key)}]`;
385
+ return result;
386
+ }
387
+ exports.stringifyPath = stringifyPath;
388
+ },
389
+ "../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/stringify.js": function(__unused_webpack_module, exports, __webpack_require__) {
390
+ Object.defineProperty(exports, "__esModule", {
391
+ value: true
392
+ });
393
+ exports.toString = void 0;
394
+ const quote_1 = __webpack_require__("../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js");
395
+ const object_1 = __webpack_require__("../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/object.js");
396
+ const function_1 = __webpack_require__("../../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/function.js");
397
+ const PRIMITIVE_TYPES = {
398
+ string: quote_1.quoteString,
399
+ number: (value)=>Object.is(value, -0) ? "-0" : String(value),
400
+ boolean: String,
401
+ symbol: (value, space, next)=>{
402
+ const key = Symbol.keyFor(value);
403
+ if (void 0 !== key) return `Symbol.for(${next(key)})`;
404
+ return `Symbol(${next(value.description)})`;
405
+ },
406
+ bigint: (value, space, next)=>`BigInt(${next(String(value))})`,
407
+ undefined: String,
408
+ object: object_1.objectToString,
409
+ function: function_1.functionToString
410
+ };
411
+ const toString = (value, space, next, key)=>{
412
+ if (null === value) return "null";
413
+ return PRIMITIVE_TYPES[typeof value](value, space, next, key);
414
+ };
415
+ exports.toString = toString;
416
+ }
417
+ };
package/dist/cli/main.js CHANGED
@@ -273,7 +273,7 @@ __webpack_require__.m = __webpack_modules__;
273
273
  }, []));
274
274
  })();
275
275
  (()=>{
276
- __webpack_require__.u = (chunkId)=>"" + chunkId + ".js";
276
+ __webpack_require__.u = (chunkId)=>"1~" + chunkId + ".js";
277
277
  })();
278
278
  (()=>{
279
279
  __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
package/dist/index.d.ts CHANGED
@@ -15,6 +15,7 @@
15
15
  * ```
16
16
  */
17
17
 
18
+ import type { CompressOptions } from '@rsbuild/core';
18
19
  import type { CreateRsbuildOptions } from '@rsbuild/core';
19
20
  import type { DataUriLimit } from '@rsbuild/core';
20
21
  import type { DistPathConfig } from '@rsbuild/core';
@@ -31,6 +32,7 @@ import { version as rsbuildVersion } from '@rsbuild/core';
31
32
  import type { RsdoctorRspackPlugin } from '@rsdoctor/rspack-plugin';
32
33
  import { Rspack } from '@rsbuild/core';
33
34
  import { rspack } from '@rsbuild/core';
35
+ import type { ServerConfig } from '@rsbuild/core';
34
36
  import type { ToolsConfig } from '@rsbuild/core';
35
37
  import type { WatchFiles } from '@rsbuild/core';
36
38
 
@@ -862,7 +864,51 @@ export declare interface CssModules {
862
864
  *
863
865
  * @remarks
864
866
  *
867
+ * The default value is `'[local]-[hash:base64:6]'` which combines the original class name with a 6-character hash.
868
+ *
869
+ * Available placeholders:
870
+ *
871
+ * - `[local]`: Original class name
872
+ *
873
+ * - `[hash]`: Hash of the class name
874
+ *
875
+ * - `[path]`: File path
876
+ *
877
+ * - `[name]`: File name
878
+ *
879
+ * - `[ext]`: File extension
880
+ *
865
881
  * See {@link https://github.com/webpack-contrib/css-loader?tab=readme-ov-file#localIdentName | css-loader#localIdentName} for details.
882
+ *
883
+ * @example
884
+ *
885
+ * Use only hash for shorter class names:
886
+ *
887
+ * ```js
888
+ * import { defineConfig } from '@lynx-js/rspeedy'
889
+ * export default defineConfig({
890
+ * output: {
891
+ * cssModules: {
892
+ * localIdentName: '[hash:base64:8]',
893
+ * },
894
+ * },
895
+ * })
896
+ * ```
897
+ *
898
+ * @example
899
+ *
900
+ * Include file name for debugging:
901
+ *
902
+ * ```js
903
+ * import { defineConfig } from '@lynx-js/rspeedy'
904
+ * export default defineConfig({
905
+ * output: {
906
+ * cssModules: {
907
+ * localIdentName: '[name]__[local]--[hash:base64:5]',
908
+ * },
909
+ * },
910
+ * })
911
+ * ```
866
912
  */
867
913
  localIdentName?: string | undefined;
868
914
  }
@@ -2590,6 +2636,44 @@ export declare interface Resolve {
2590
2636
  * ```
2591
2637
  */
2592
2638
  dedupe?: string[] | undefined;
2639
+ /**
2640
+ * Automatically resolve file extensions when importing modules. This means you can import files without explicitly writing their extensions.
2641
+ *
2642
+ * Default: `['.ts', '.tsx', '.mjs', '.js', '.jsx', '.json', '.cjs']`
2643
+ *
2644
+ * For example, if importing './index', Rsbuild will try to resolve using the following order:
2645
+ *
2646
+ * - `./index.ts`
2647
+ *
2648
+ * - `./index.tsx`
2649
+ *
2650
+ * - `./index.mjs`
2651
+ *
2652
+ * - `./index.js`
2653
+ *
2654
+ * - `./index.jsx`
2655
+ *
2656
+ * - `./index.json`
2657
+ *
2658
+ * - `./index.cjs`
2659
+ *
2660
+ * @remarks
2661
+ * The difference between `resolve.extensions` and `tools.rspack.resolve.extensions`:
2662
+ *
2663
+ * `resolve.extensions`: Completely overrides Rspeedy's default resolution.
2664
+ *
2665
+ * `tools.rspack.resolve.extensions`: Merges with the default configuration using [`webpack-merge`](https://github.com/survivejs/webpack-merge).
2666
+ *
2667
+ * @example
2668
+ * ```js
2669
+ * export default {
2670
+ * resolve: {
2671
+ * extensions: ['.ts', '.tsx', '.js'],
2672
+ * },
2673
+ * }
2674
+ * ```
2675
+ */
2676
+ extensions?: string[] | undefined;
2593
2677
  }
2594
2678
 
2595
2679
  export { RsbuildPlugin }
@@ -2642,6 +2726,83 @@ export declare interface Server {
2642
2726
  * ```
2643
2727
  */
2644
2728
  base?: string | undefined;
2729
+ /**
2730
+ * Configure whether to enable {@link https://developer.mozilla.org/en-US/docs/Glossary/gzip_compression | gzip compression } for static assets served by the dev server or preview server.
2731
+ *
2732
+ * Default: true
2733
+ *
2734
+ * See {@link https://rsbuild.rs/config/server/compress | Rsbuild - server.compress } for details.
2735
+ *
2736
+ * @example
2737
+ *
2738
+ * To disable the gzip compression, set compress to false:
2739
+ *
2740
+ * ```js
2741
+ * export default {
2742
+ * server: {
2743
+ * compress: false,
2744
+ * },
2745
+ * }
2746
+ * ```
2747
+ *
2748
+ * @example
2749
+ *
2750
+ * Compress if it starts with /foo
2751
+ *
2752
+ * ```js
2753
+ * export default {
2754
+ * server: {
2755
+ * compress: {
2756
+ * filter: (req) => {
2757
+ * if (req.url?.includes('/foo')) {
2758
+ * return false;
2759
+ * }
2760
+ * return true;
2761
+ * },
2762
+ * },
2763
+ * },
2764
+ * }
2765
+ * ```
2766
+ *
2767
+ * @example
2768
+ *
2769
+ * set level of zlib compression
2770
+ *
2771
+ * ```js
2772
+ * export default {
2773
+ * server: {
2774
+ * compress: {
2775
+ * level: 6,
2776
+ * },
2777
+ * },
2778
+ * }
2779
+ * ```
2780
+ */
2781
+ compress?: boolean | CompressOptions | undefined;
2782
+ /**
2783
+ * Configure CORS for the dev server or preview server.
2784
+ *
2785
+ * - Set to an object to enable CORS with the specified options.
2786
+ *
2787
+ * - Set to `true` to enable CORS with the default options (allows all origins, not recommended).
2788
+ *
2789
+ * - Set to `false` to disable CORS.
2790
+ *
2791
+ * See {@link https://rsbuild.rs/config/server/cors | Rsbuild - server.cors } for details.
2792
+ *
2793
+ * @example
2794
+ *
2795
+ * ```js
2796
+ * export default {
2797
+ * server: {
2798
+ * cors: {
2799
+ * origin: 'https://example.com',
2800
+ * },
2801
+ * },
2802
+ * }
2803
+ * ```
2804
+ */
2805
+ cors?: ServerConfig['cors'] | undefined;
2645
2806
  /**
2646
2807
  * Adds headers to all responses.
2647
2808
  *
package/dist/index.js CHANGED
@@ -108,7 +108,7 @@ var __webpack_modules__ = {
108
108
  });
109
109
  var core_ = __webpack_require__("@rsbuild/core");
110
110
  var package_namespaceObject = {
111
- rE: "0.11.2"
111
+ rE: "0.11.4"
112
112
  };
113
113
  const version = package_namespaceObject.rE;
114
114
  const rspackVersion = core_.rspack.rspackVersion;
@@ -183,7 +183,7 @@ __webpack_require__.m = __webpack_modules__;
183
183
  }, []));
184
184
  })();
185
185
  (()=>{
186
- __webpack_require__.u = (chunkId)=>"" + chunkId + ".js";
186
+ __webpack_require__.u = (chunkId)=>"0~" + chunkId + ".js";
187
187
  })();
188
188
  (()=>{
189
189
  __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
@@ -248,7 +248,10 @@ function applyDefaultRspeedyConfig(config) {
248
248
  })(),
249
249
  output: {
250
250
  filename: getFilename(config.output?.filename),
251
- inlineScripts: !enableChunkSplitting
251
+ inlineScripts: !enableChunkSplitting,
252
+ cssModules: {
253
+ localIdentName: '[local]-[hash:base64:6]'
254
+ }
252
255
  },
253
256
  performance: {
254
257
  profile: (0, debug._o)() ? true : void 0
@@ -344,7 +347,8 @@ function toRsbuildConfig(config) {
344
347
  resolve: {
345
348
  alias: config.resolve?.alias,
346
349
  aliasStrategy: config.resolve?.aliasStrategy,
347
- dedupe: config.resolve?.dedupe
350
+ dedupe: config.resolve?.dedupe,
351
+ extensions: config.resolve?.extensions
348
352
  },
349
353
  source: {
350
354
  alias: config.source?.alias,
@@ -360,6 +364,8 @@ function toRsbuildConfig(config) {
360
364
  },
361
365
  server: {
362
366
  base: config.server?.base,
367
+ compress: config.server?.compress,
368
+ cors: config.server?.cors,
363
369
  headers: config.server?.headers,
364
370
  host: config.server?.host,
365
371
  port: config.server?.port,