@lynx-js/rspeedy-canary 0.10.2 → 0.10.3-canary-20250721-a3ae4c5e

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @lynx-js/rspeedy
2
2
 
3
+ ## 0.10.3-canary-20250721113631-a3ae4c5ebf1d8b44b15a3564b8590d4c6ae7b70b
4
+
5
+ ### Patch Changes
6
+
7
+ - Should be able to override `performance.profile` when `DEBUG=rspeedy`. ([#1307](https://github.com/lynx-family/lynx-stack/pull/1307))
8
+
3
9
  ## 0.10.2
4
10
 
5
11
  ### Patch Changes
@@ -37,28 +43,28 @@
37
43
 
38
44
  ```ts
39
45
  type InlineChunkTestFunction = (params: {
40
- size: number
41
- name: string
42
- }) => boolean
46
+ size: number;
47
+ name: string;
48
+ }) => boolean;
43
49
 
44
- type InlineChunkTest = RegExp | InlineChunkTestFunction
50
+ type InlineChunkTest = RegExp | InlineChunkTestFunction;
45
51
 
46
52
  type InlineChunkConfig =
47
53
  | boolean
48
54
  | InlineChunkTest
49
- | { enable?: boolean | 'auto', test: InlineChunkTest }
55
+ | { enable?: boolean | "auto"; test: InlineChunkTest };
50
56
  ```
51
57
 
52
58
  ```ts
53
- import { defineConfig } from '@lynx-js/rspeedy'
59
+ import { defineConfig } from "@lynx-js/rspeedy";
54
60
 
55
61
  export default defineConfig({
56
62
  output: {
57
63
  inlineScripts: ({ name, size }) => {
58
- return name.includes('foo') && size < 1000
64
+ return name.includes("foo") && size < 1000;
59
65
  },
60
66
  },
61
- })
67
+ });
62
68
  ```
63
69
 
64
70
  - docs: remove chunks: 'all' in comments ([#1168](https://github.com/lynx-family/lynx-stack/pull/1168))
@@ -101,13 +107,13 @@
101
107
  example:
102
108
 
103
109
  ```js
104
- import { defineConfig } from '@lynx-js/rspeedy'
110
+ import { defineConfig } from "@lynx-js/rspeedy";
105
111
 
106
112
  export default defineConfig({
107
113
  output: {
108
114
  inlineScripts: false,
109
115
  },
110
- })
116
+ });
111
117
  ```
112
118
 
113
119
  - Bump Rsbuild v1.3.21 with Rspack v1.3.11. ([#863](https://github.com/lynx-family/lynx-stack/pull/863))
@@ -127,12 +133,12 @@
127
133
  example:
128
134
 
129
135
  ```js
130
- import { defineConfig } from '@lynx-js/rspeedy'
136
+ import { defineConfig } from "@lynx-js/rspeedy";
131
137
  export default defineConfig({
132
138
  source: {
133
- preEntry: './src/polyfill.ts',
139
+ preEntry: "./src/polyfill.ts",
134
140
  },
135
- })
141
+ });
136
142
  ```
137
143
 
138
144
  - Bump Rsbuild v1.3.20 with Rspack v1.3.10. ([#799](https://github.com/lynx-family/lynx-stack/pull/799))
@@ -143,17 +149,17 @@
143
149
 
144
150
  ```js
145
151
  export const myPlugin = {
146
- name: 'my-plugin',
152
+ name: "my-plugin",
147
153
  setup(api) {
148
- const { callerName } = api.context
154
+ const { callerName } = api.context;
149
155
 
150
- if (callerName === 'rslib') {
156
+ if (callerName === "rslib") {
151
157
  // ...
152
- } else if (callerName === 'rspeedy') {
158
+ } else if (callerName === "rspeedy") {
153
159
  // ...
154
160
  }
155
161
  },
156
- }
162
+ };
157
163
  ```
158
164
 
159
165
  - Support `performance.buildCache`. ([#766](https://github.com/lynx-family/lynx-stack/pull/766))
@@ -176,7 +182,7 @@
176
182
  Set `tools.rsdoctor.experiments.enableNativePlugin` to `false` to use the old JS plugin.
177
183
 
178
184
  ```js
179
- import { defineConfig } from '@lynx-js/rspeedy'
185
+ import { defineConfig } from "@lynx-js/rspeedy";
180
186
 
181
187
  export default defineConfig({
182
188
  tools: {
@@ -186,7 +192,7 @@
186
192
  },
187
193
  },
188
194
  },
189
- })
195
+ });
190
196
  ```
191
197
 
192
198
  See [Rsdoctor - 1.0](https://rsdoctor.dev/blog/release/release-note-1_0#-faster-analysis) for more details.
@@ -318,12 +324,12 @@
318
324
  example:
319
325
 
320
326
  ```js
321
- import { defineConfig } from '@lynx-js/rspeedy'
327
+ import { defineConfig } from "@lynx-js/rspeedy";
322
328
  export default defineConfig({
323
329
  server: {
324
- base: '/dist',
330
+ base: "/dist",
325
331
  },
326
- })
332
+ });
327
333
  ```
328
334
 
329
335
  - Updated dependencies [[`b026c8b`](https://github.com/lynx-family/lynx-stack/commit/b026c8bdcbf7bdcda73e170477297213b447d876)]:
@@ -376,11 +382,11 @@
376
382
  You can switch to other tools by using:
377
383
 
378
384
  ```js
379
- import { defineConfig } from '@lynx-js/rspeedy'
385
+ import { defineConfig } from "@lynx-js/rspeedy";
380
386
  import {
381
387
  CssMinimizerWebpackPlugin,
382
388
  pluginCssMinimizer,
383
- } from '@rsbuild/plugin-css-minimizer'
389
+ } from "@rsbuild/plugin-css-minimizer";
384
390
 
385
391
  export default defineConfig({
386
392
  plugins: [
@@ -393,7 +399,7 @@
393
399
  },
394
400
  }),
395
401
  ],
396
- })
402
+ });
397
403
  ```
398
404
 
399
405
  See [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) for details.
@@ -403,8 +409,8 @@
403
409
  You can use custom options with [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer):
404
410
 
405
411
  ```js
406
- import { defineConfig } from '@lynx-js/rspeedy'
407
- import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
412
+ import { defineConfig } from "@lynx-js/rspeedy";
413
+ import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
408
414
 
409
415
  export default defineConfig({
410
416
  plugins: [
@@ -416,7 +422,7 @@
416
422
  },
417
423
  }),
418
424
  ],
419
- })
425
+ });
420
426
  ```
421
427
 
422
428
  ## 0.7.1
@@ -436,7 +442,7 @@
436
442
  You may turn it off using `output.minify.css: false`:
437
443
 
438
444
  ```js
439
- import { defineConfig } from '@lynx-js/rspeedy'
445
+ import { defineConfig } from "@lynx-js/rspeedy";
440
446
 
441
447
  export default defineConfig({
442
448
  output: {
@@ -444,18 +450,18 @@
444
450
  css: false,
445
451
  },
446
452
  },
447
- })
453
+ });
448
454
  ```
449
455
 
450
456
  Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
451
457
 
452
458
  ```js
453
- import { defineConfig } from '@lynx-js/rspeedy'
454
- import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
459
+ import { defineConfig } from "@lynx-js/rspeedy";
460
+ import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
455
461
 
456
462
  export default defineConfig({
457
463
  plugins: [pluginCssMinimizer()],
458
- })
464
+ });
459
465
  ```
460
466
 
461
467
  - 525554c: **BREAKING CHANGE**: Bump ts-blank-space to ^0.6.0.
@@ -482,22 +488,22 @@
482
488
  - The new `type: 'reload-server'` will restart the development server when it detects changes in the specified files.
483
489
 
484
490
  ```js
485
- import { defineConfig } from '@lynx-js/rspeedy'
491
+ import { defineConfig } from "@lynx-js/rspeedy";
486
492
 
487
493
  export default defineConfig({
488
494
  dev: {
489
495
  watchFiles: [
490
496
  {
491
- type: 'reload-server',
492
- paths: ['public/**/*.txt'],
497
+ type: "reload-server",
498
+ paths: ["public/**/*.txt"],
493
499
  },
494
500
  {
495
- type: 'reload-page',
496
- paths: ['public/**/*.json'],
501
+ type: "reload-page",
502
+ paths: ["public/**/*.json"],
497
503
  },
498
504
  ],
499
505
  },
500
- })
506
+ });
501
507
  ```
502
508
 
503
509
  - be9b003: Add `source.exclude`.
package/dist/index.js CHANGED
@@ -253,8 +253,9 @@ __webpack_require__.m = __webpack_modules__;
253
253
  })();
254
254
  var external_node_path_ = __webpack_require__("node:path");
255
255
  var core_ = __webpack_require__("@rsbuild/core");
256
+ var debug = __webpack_require__("./src/debug.ts");
256
257
  function applyDefaultRspeedyConfig(config) {
257
- const ret = (0, core_.mergeRsbuildConfig)({
258
+ return (0, core_.mergeRsbuildConfig)({
258
259
  mode: (()=>{
259
260
  if (config.mode) return config.mode;
260
261
  const nodeEnv = process.env['NODE_ENV'];
@@ -264,6 +265,9 @@ function applyDefaultRspeedyConfig(config) {
264
265
  filename: getFilename(config.output?.filename),
265
266
  inlineScripts: true
266
267
  },
268
+ performance: {
269
+ profile: (0, debug.L1)() ? true : void 0
270
+ },
267
271
  tools: {
268
272
  rsdoctor: {
269
273
  experiments: {
@@ -272,7 +276,6 @@ function applyDefaultRspeedyConfig(config) {
272
276
  }
273
277
  }
274
278
  }, config);
275
- return ret;
276
279
  }
277
280
  const DEFAULT_FILENAME = '[name].[platform].bundle';
278
281
  function getFilename(filename) {
@@ -286,7 +289,6 @@ function getFilename(filename) {
286
289
  template: finalFilename
287
290
  };
288
291
  }
289
- var debug = __webpack_require__("./src/debug.ts");
290
292
  const DEFAULT_ENTRY = './src/index.js';
291
293
  function toRsbuildEntry(entry) {
292
294
  if (void 0 === entry) {
@@ -140,8 +140,9 @@ export const __webpack_modules__ = {
140
140
  });
141
141
  var external_node_path_ = __webpack_require__("node:path");
142
142
  var core_ = __webpack_require__("@rsbuild/core");
143
+ var debug = __webpack_require__("./src/debug.ts");
143
144
  function applyDefaultRspeedyConfig(config) {
144
- const ret = (0, core_.mergeRsbuildConfig)({
145
+ return (0, core_.mergeRsbuildConfig)({
145
146
  mode: (()=>{
146
147
  if (config.mode) return config.mode;
147
148
  const nodeEnv = process.env['NODE_ENV'];
@@ -151,6 +152,9 @@ export const __webpack_modules__ = {
151
152
  filename: getFilename(config.output?.filename),
152
153
  inlineScripts: true
153
154
  },
155
+ performance: {
156
+ profile: (0, debug.L1)() ? true : void 0
157
+ },
154
158
  tools: {
155
159
  rsdoctor: {
156
160
  experiments: {
@@ -159,7 +163,6 @@ export const __webpack_modules__ = {
159
163
  }
160
164
  }
161
165
  }, config);
162
- return ret;
163
166
  }
164
167
  const DEFAULT_FILENAME = '[name].[platform].bundle';
165
168
  function getFilename(filename) {
@@ -173,7 +176,6 @@ export const __webpack_modules__ = {
173
176
  template: finalFilename
174
177
  };
175
178
  }
176
- var debug = __webpack_require__("./src/debug.ts");
177
179
  const DEFAULT_ENTRY = './src/index.js';
178
180
  function toRsbuildEntry(entry) {
179
181
  if (void 0 === entry) {
@@ -183,8 +183,9 @@ export const __webpack_modules__ = {
183
183
  });
184
184
  var external_node_path_ = __webpack_require__("node:path");
185
185
  var core_ = __webpack_require__("@rsbuild/core");
186
+ var debug = __webpack_require__("./src/debug.ts");
186
187
  function applyDefaultRspeedyConfig(config) {
187
- const ret = (0, core_.mergeRsbuildConfig)({
188
+ return (0, core_.mergeRsbuildConfig)({
188
189
  mode: (()=>{
189
190
  if (config.mode) return config.mode;
190
191
  const nodeEnv = process.env['NODE_ENV'];
@@ -194,6 +195,9 @@ export const __webpack_modules__ = {
194
195
  filename: getFilename(config.output?.filename),
195
196
  inlineScripts: true
196
197
  },
198
+ performance: {
199
+ profile: (0, debug.L1)() ? true : void 0
200
+ },
197
201
  tools: {
198
202
  rsdoctor: {
199
203
  experiments: {
@@ -202,7 +206,6 @@ export const __webpack_modules__ = {
202
206
  }
203
207
  }
204
208
  }, config);
205
- return ret;
206
209
  }
207
210
  const DEFAULT_FILENAME = '[name].[platform].bundle';
208
211
  function getFilename(filename) {
@@ -216,7 +219,6 @@ export const __webpack_modules__ = {
216
219
  template: finalFilename
217
220
  };
218
221
  }
219
- var debug = __webpack_require__("./src/debug.ts");
220
222
  const DEFAULT_ENTRY = './src/index.js';
221
223
  function toRsbuildEntry(entry) {
222
224
  if (void 0 === entry) {
@@ -143,8 +143,9 @@ export const __webpack_modules__ = {
143
143
  });
144
144
  var external_node_path_ = __webpack_require__("node:path");
145
145
  var core_ = __webpack_require__("@rsbuild/core");
146
+ var debug = __webpack_require__("./src/debug.ts");
146
147
  function applyDefaultRspeedyConfig(config) {
147
- const ret = (0, core_.mergeRsbuildConfig)({
148
+ return (0, core_.mergeRsbuildConfig)({
148
149
  mode: (()=>{
149
150
  if (config.mode) return config.mode;
150
151
  const nodeEnv = process.env['NODE_ENV'];
@@ -154,6 +155,9 @@ export const __webpack_modules__ = {
154
155
  filename: getFilename(config.output?.filename),
155
156
  inlineScripts: true
156
157
  },
158
+ performance: {
159
+ profile: (0, debug.L1)() ? true : void 0
160
+ },
157
161
  tools: {
158
162
  rsdoctor: {
159
163
  experiments: {
@@ -162,7 +166,6 @@ export const __webpack_modules__ = {
162
166
  }
163
167
  }
164
168
  }, config);
165
- return ret;
166
169
  }
167
170
  const DEFAULT_FILENAME = '[name].[platform].bundle';
168
171
  function getFilename(filename) {
@@ -176,7 +179,6 @@ export const __webpack_modules__ = {
176
179
  template: finalFilename
177
180
  };
178
181
  }
179
- var debug = __webpack_require__("./src/debug.ts");
180
182
  const DEFAULT_ENTRY = './src/index.js';
181
183
  function toRsbuildEntry(entry) {
182
184
  if (void 0 === entry) {
@@ -145,8 +145,9 @@ export const __webpack_modules__ = {
145
145
  });
146
146
  var external_node_path_ = __webpack_require__("node:path");
147
147
  var core_ = __webpack_require__("@rsbuild/core");
148
+ var debug = __webpack_require__("./src/debug.ts");
148
149
  function applyDefaultRspeedyConfig(config) {
149
- const ret = (0, core_.mergeRsbuildConfig)({
150
+ return (0, core_.mergeRsbuildConfig)({
150
151
  mode: (()=>{
151
152
  if (config.mode) return config.mode;
152
153
  const nodeEnv = process.env['NODE_ENV'];
@@ -156,6 +157,9 @@ export const __webpack_modules__ = {
156
157
  filename: getFilename(config.output?.filename),
157
158
  inlineScripts: true
158
159
  },
160
+ performance: {
161
+ profile: (0, debug.L1)() ? true : void 0
162
+ },
159
163
  tools: {
160
164
  rsdoctor: {
161
165
  experiments: {
@@ -164,7 +168,6 @@ export const __webpack_modules__ = {
164
168
  }
165
169
  }
166
170
  }, config);
167
- return ret;
168
171
  }
169
172
  const DEFAULT_FILENAME = '[name].[platform].bundle';
170
173
  function getFilename(filename) {
@@ -178,7 +181,6 @@ export const __webpack_modules__ = {
178
181
  template: finalFilename
179
182
  };
180
183
  }
181
- var debug = __webpack_require__("./src/debug.ts");
182
184
  const DEFAULT_ENTRY = './src/index.js';
183
185
  function toRsbuildEntry(entry) {
184
186
  if (void 0 === entry) {
@@ -19,11 +19,11 @@ export const __webpack_modules__ = {
19
19
  config,
20
20
  debug: _debug_js__WEBPACK_IMPORTED_MODULE_1__.fF,
21
21
  async exit (code) {
22
- const { exit } = await __webpack_require__.e("src_cli_exit_ts").then(__webpack_require__.bind(__webpack_require__, "./src/cli/exit.ts"));
22
+ const { exit } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "./src/cli/exit.ts"));
23
23
  return exit(code);
24
24
  },
25
25
  logger: _rsbuild_core__WEBPACK_IMPORTED_MODULE_0__.logger,
26
- version: _version_js__WEBPACK_IMPORTED_MODULE_2__.i8
26
+ version: _version_js__WEBPACK_IMPORTED_MODULE_2__.version
27
27
  });
28
28
  }
29
29
  };
@@ -14,8 +14,7 @@ export const __webpack_modules__ = {
14
14
  Promise.all([
15
15
  __webpack_require__.e("vendors-node_modules_pnpm_javascript-stringify_2_1_0_node_modules_javascript-stringify_dist_i-562fbc"),
16
16
  __webpack_require__.e("src_plugins_inspect_plugin_ts")
17
- ]).then(__webpack_require__.bind(__webpack_require__, "./src/plugins/inspect.plugin.ts")).then(({ pluginInspect })=>pluginInspect(config)),
18
- __webpack_require__.e("src_plugins_stats_plugin_ts").then(__webpack_require__.bind(__webpack_require__, "./src/plugins/stats.plugin.ts")).then(({ pluginStats })=>pluginStats())
17
+ ]).then(__webpack_require__.bind(__webpack_require__, "./src/plugins/inspect.plugin.ts")).then(({ pluginInspect })=>pluginInspect(config))
19
18
  ]);
20
19
  rsbuildInstance.addPlugins(await Promise.all(debugPlugins));
21
20
  }
@@ -7,10 +7,8 @@ export const __webpack_modules__ = {
7
7
  __webpack_require__.d(__webpack_exports__, {
8
8
  pluginRsdoctor: ()=>pluginRsdoctor
9
9
  });
10
- var core_ = __webpack_require__("@rsbuild/core");
11
- function isCI() {
12
- return !!process.env['CI'] && 'false' !== process.env['CI'];
13
- }
10
+ var _rsbuild_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("@rsbuild/core");
11
+ var _utils_is_ci_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/utils/is-ci.ts");
14
12
  function pluginRsdoctor(options) {
15
13
  return {
16
14
  name: 'lynx:rsbuild:rsdoctor',
@@ -27,7 +25,7 @@ export const __webpack_modules__ = {
27
25
  if (registered) continue;
28
26
  config.plugins ??= [];
29
27
  const defaultOptions = {
30
- disableClientServer: isCI(),
28
+ disableClientServer: (0, _utils_is_ci_js__WEBPACK_IMPORTED_MODULE_1__.y)(),
31
29
  supports: {
32
30
  banner: true
33
31
  },
@@ -42,12 +40,20 @@ export const __webpack_modules__ = {
42
40
  }
43
41
  }
44
42
  };
45
- config.plugins.push(new RsdoctorRspackPlugin((0, core_.mergeRsbuildConfig)(defaultOptions, options)));
43
+ config.plugins.push(new RsdoctorRspackPlugin((0, _rsbuild_core__WEBPACK_IMPORTED_MODULE_0__.mergeRsbuildConfig)(defaultOptions, options)));
46
44
  }
47
- core_.logger.info("Rsdoctor is enabled.");
45
+ _rsbuild_core__WEBPACK_IMPORTED_MODULE_0__.logger.info("Rsdoctor is enabled.");
48
46
  });
49
47
  }
50
48
  };
51
49
  }
50
+ },
51
+ "./src/utils/is-ci.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
52
+ __webpack_require__.d(__webpack_exports__, {
53
+ y: ()=>isCI
54
+ });
55
+ function isCI() {
56
+ return !!process.env['CI'] && 'false' !== process.env['CI'];
57
+ }
52
58
  }
53
59
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/rspeedy-canary",
3
- "version": "0.10.2",
3
+ "version": "0.10.3-canary-20250721-a3ae4c5e",
4
4
  "description": "A webpack/rspack-based frontend toolchain for Lynx",
5
5
  "keywords": [
6
6
  "webpack",
@@ -1,23 +0,0 @@
1
- export const __webpack_ids__ = [
2
- "src_plugins_stats_plugin_ts"
3
- ];
4
- export const __webpack_modules__ = {
5
- "./src/plugins/stats.plugin.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6
- __webpack_require__.r(__webpack_exports__);
7
- __webpack_require__.d(__webpack_exports__, {
8
- pluginStats: ()=>pluginStats
9
- });
10
- function pluginStats() {
11
- return {
12
- name: 'lynx:rsbuild:stats',
13
- setup (api) {
14
- api.modifyRsbuildConfig((config, { mergeRsbuildConfig })=>mergeRsbuildConfig(config, {
15
- performance: {
16
- profile: true
17
- }
18
- }));
19
- }
20
- };
21
- }
22
- }
23
- };