@lynx-js/rspeedy-canary 0.11.2 → 0.11.3-canary-20250918-b17b7cb2

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.11.3-canary-20250918080343-b17b7cb2bb92d1539e76276f136806eefa788258
4
+
5
+ ### Patch Changes
6
+
7
+ - Support `resolve.extensions` ([#1759](https://github.com/lynx-family/lynx-stack/pull/1759))
8
+
3
9
  ## 0.11.2
4
10
 
5
11
  ### Patch Changes
@@ -9,11 +15,11 @@
9
15
  - Support `command` and `env` parameters in the function exported by `lynx.config.js`. ([#1669](https://github.com/lynx-family/lynx-stack/pull/1669))
10
16
 
11
17
  ```js
12
- import { defineConfig } from '@lynx-js/rspeedy'
18
+ import { defineConfig } from "@lynx-js/rspeedy";
13
19
 
14
20
  export default defineConfig(({ command, env }) => {
15
- const isBuild = command === 'build'
16
- const isTest = env === 'test'
21
+ const isBuild = command === "build";
22
+ const isTest = env === "test";
17
23
 
18
24
  return {
19
25
  output: {
@@ -22,8 +28,8 @@
22
28
  performance: {
23
29
  buildCache: isBuild,
24
30
  },
25
- }
26
- })
31
+ };
32
+ });
27
33
  ```
28
34
 
29
35
  - Support `resolve.dedupe`. ([#1671](https://github.com/lynx-family/lynx-stack/pull/1671))
@@ -31,30 +37,30 @@
31
37
  This is useful when having multiple duplicated packages in the bundle:
32
38
 
33
39
  ```js
34
- import { defineConfig } from '@lynx-js/rspeedy'
40
+ import { defineConfig } from "@lynx-js/rspeedy";
35
41
 
36
42
  export default defineConfig({
37
43
  resolve: {
38
- dedupe: ['tslib'],
44
+ dedupe: ["tslib"],
39
45
  },
40
- })
46
+ });
41
47
  ```
42
48
 
43
49
  - Support `resolve.aliasStrategy` for controlling priority between `tsconfig.json` paths and `resolve.alias` ([#1722](https://github.com/lynx-family/lynx-stack/pull/1722))
44
50
 
45
51
  ```js
46
- import { defineConfig } from '@lynx-js/rspeedy'
52
+ import { defineConfig } from "@lynx-js/rspeedy";
47
53
 
48
54
  export default defineConfig({
49
55
  resolve: {
50
56
  alias: {
51
- '@': './src',
57
+ "@": "./src",
52
58
  },
53
59
  // 'prefer-tsconfig' (default): tsconfig.json paths take priority
54
60
  // 'prefer-alias': resolve.alias takes priority
55
- aliasStrategy: 'prefer-alias',
61
+ aliasStrategy: "prefer-alias",
56
62
  },
57
- })
63
+ });
58
64
  ```
59
65
 
60
66
  - Bump Rsbuild v1.5.4 with Rspack v1.5.2. ([#1644](https://github.com/lynx-family/lynx-stack/pull/1644))
@@ -74,7 +80,7 @@
74
80
  - Add `output.dataUriLimit.*` for fine-grained control of asset inlining. ([#1648](https://github.com/lynx-family/lynx-stack/pull/1648))
75
81
 
76
82
  ```js
77
- import { defineConfig } from '@lynx-js/rspeedy'
83
+ import { defineConfig } from "@lynx-js/rspeedy";
78
84
 
79
85
  export default defineConfig({
80
86
  output: {
@@ -83,7 +89,7 @@
83
89
  media: 0,
84
90
  },
85
91
  },
86
- })
92
+ });
87
93
  ```
88
94
 
89
95
  ## 0.11.0
@@ -203,28 +209,28 @@
203
209
 
204
210
  ```ts
205
211
  type InlineChunkTestFunction = (params: {
206
- size: number
207
- name: string
208
- }) => boolean
212
+ size: number;
213
+ name: string;
214
+ }) => boolean;
209
215
 
210
- type InlineChunkTest = RegExp | InlineChunkTestFunction
216
+ type InlineChunkTest = RegExp | InlineChunkTestFunction;
211
217
 
212
218
  type InlineChunkConfig =
213
219
  | boolean
214
220
  | InlineChunkTest
215
- | { enable?: boolean | 'auto', test: InlineChunkTest }
221
+ | { enable?: boolean | "auto"; test: InlineChunkTest };
216
222
  ```
217
223
 
218
224
  ```ts
219
- import { defineConfig } from '@lynx-js/rspeedy'
225
+ import { defineConfig } from "@lynx-js/rspeedy";
220
226
 
221
227
  export default defineConfig({
222
228
  output: {
223
229
  inlineScripts: ({ name, size }) => {
224
- return name.includes('foo') && size < 1000
230
+ return name.includes("foo") && size < 1000;
225
231
  },
226
232
  },
227
- })
233
+ });
228
234
  ```
229
235
 
230
236
  - docs: remove chunks: 'all' in comments ([#1168](https://github.com/lynx-family/lynx-stack/pull/1168))
@@ -267,13 +273,13 @@
267
273
  example:
268
274
 
269
275
  ```js
270
- import { defineConfig } from '@lynx-js/rspeedy'
276
+ import { defineConfig } from "@lynx-js/rspeedy";
271
277
 
272
278
  export default defineConfig({
273
279
  output: {
274
280
  inlineScripts: false,
275
281
  },
276
- })
282
+ });
277
283
  ```
278
284
 
279
285
  - Bump Rsbuild v1.3.21 with Rspack v1.3.11. ([#863](https://github.com/lynx-family/lynx-stack/pull/863))
@@ -293,12 +299,12 @@
293
299
  example:
294
300
 
295
301
  ```js
296
- import { defineConfig } from '@lynx-js/rspeedy'
302
+ import { defineConfig } from "@lynx-js/rspeedy";
297
303
  export default defineConfig({
298
304
  source: {
299
- preEntry: './src/polyfill.ts',
305
+ preEntry: "./src/polyfill.ts",
300
306
  },
301
- })
307
+ });
302
308
  ```
303
309
 
304
310
  - Bump Rsbuild v1.3.20 with Rspack v1.3.10. ([#799](https://github.com/lynx-family/lynx-stack/pull/799))
@@ -309,17 +315,17 @@
309
315
 
310
316
  ```js
311
317
  export const myPlugin = {
312
- name: 'my-plugin',
318
+ name: "my-plugin",
313
319
  setup(api) {
314
- const { callerName } = api.context
320
+ const { callerName } = api.context;
315
321
 
316
- if (callerName === 'rslib') {
322
+ if (callerName === "rslib") {
317
323
  // ...
318
- } else if (callerName === 'rspeedy') {
324
+ } else if (callerName === "rspeedy") {
319
325
  // ...
320
326
  }
321
327
  },
322
- }
328
+ };
323
329
  ```
324
330
 
325
331
  - Support `performance.buildCache`. ([#766](https://github.com/lynx-family/lynx-stack/pull/766))
@@ -342,7 +348,7 @@
342
348
  Set `tools.rsdoctor.experiments.enableNativePlugin` to `false` to use the old JS plugin.
343
349
 
344
350
  ```js
345
- import { defineConfig } from '@lynx-js/rspeedy'
351
+ import { defineConfig } from "@lynx-js/rspeedy";
346
352
 
347
353
  export default defineConfig({
348
354
  tools: {
@@ -352,7 +358,7 @@
352
358
  },
353
359
  },
354
360
  },
355
- })
361
+ });
356
362
  ```
357
363
 
358
364
  See [Rsdoctor - 1.0](https://rsdoctor.dev/blog/release/release-note-1_0#-faster-analysis) for more details.
@@ -484,12 +490,12 @@
484
490
  example:
485
491
 
486
492
  ```js
487
- import { defineConfig } from '@lynx-js/rspeedy'
493
+ import { defineConfig } from "@lynx-js/rspeedy";
488
494
  export default defineConfig({
489
495
  server: {
490
- base: '/dist',
496
+ base: "/dist",
491
497
  },
492
- })
498
+ });
493
499
  ```
494
500
 
495
501
  - Updated dependencies [[`b026c8b`](https://github.com/lynx-family/lynx-stack/commit/b026c8bdcbf7bdcda73e170477297213b447d876)]:
@@ -542,11 +548,11 @@
542
548
  You can switch to other tools by using:
543
549
 
544
550
  ```js
545
- import { defineConfig } from '@lynx-js/rspeedy'
551
+ import { defineConfig } from "@lynx-js/rspeedy";
546
552
  import {
547
553
  CssMinimizerWebpackPlugin,
548
554
  pluginCssMinimizer,
549
- } from '@rsbuild/plugin-css-minimizer'
555
+ } from "@rsbuild/plugin-css-minimizer";
550
556
 
551
557
  export default defineConfig({
552
558
  plugins: [
@@ -559,7 +565,7 @@
559
565
  },
560
566
  }),
561
567
  ],
562
- })
568
+ });
563
569
  ```
564
570
 
565
571
  See [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) for details.
@@ -569,8 +575,8 @@
569
575
  You can use custom options with [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer):
570
576
 
571
577
  ```js
572
- import { defineConfig } from '@lynx-js/rspeedy'
573
- import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
578
+ import { defineConfig } from "@lynx-js/rspeedy";
579
+ import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
574
580
 
575
581
  export default defineConfig({
576
582
  plugins: [
@@ -582,7 +588,7 @@
582
588
  },
583
589
  }),
584
590
  ],
585
- })
591
+ });
586
592
  ```
587
593
 
588
594
  ## 0.7.1
@@ -602,7 +608,7 @@
602
608
  You may turn it off using `output.minify.css: false`:
603
609
 
604
610
  ```js
605
- import { defineConfig } from '@lynx-js/rspeedy'
611
+ import { defineConfig } from "@lynx-js/rspeedy";
606
612
 
607
613
  export default defineConfig({
608
614
  output: {
@@ -610,18 +616,18 @@
610
616
  css: false,
611
617
  },
612
618
  },
613
- })
619
+ });
614
620
  ```
615
621
 
616
622
  Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
617
623
 
618
624
  ```js
619
- import { defineConfig } from '@lynx-js/rspeedy'
620
- import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
625
+ import { defineConfig } from "@lynx-js/rspeedy";
626
+ import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
621
627
 
622
628
  export default defineConfig({
623
629
  plugins: [pluginCssMinimizer()],
624
- })
630
+ });
625
631
  ```
626
632
 
627
633
  - 525554c: **BREAKING CHANGE**: Bump ts-blank-space to ^0.6.0.
@@ -648,22 +654,22 @@
648
654
  - The new `type: 'reload-server'` will restart the development server when it detects changes in the specified files.
649
655
 
650
656
  ```js
651
- import { defineConfig } from '@lynx-js/rspeedy'
657
+ import { defineConfig } from "@lynx-js/rspeedy";
652
658
 
653
659
  export default defineConfig({
654
660
  dev: {
655
661
  watchFiles: [
656
662
  {
657
- type: 'reload-server',
658
- paths: ['public/**/*.txt'],
663
+ type: "reload-server",
664
+ paths: ["public/**/*.txt"],
659
665
  },
660
666
  {
661
- type: 'reload-page',
662
- paths: ['public/**/*.json'],
667
+ type: "reload-page",
668
+ paths: ["public/**/*.json"],
663
669
  },
664
670
  ],
665
671
  },
666
- })
672
+ });
667
673
  ```
668
674
 
669
675
  - be9b003: Add `source.exclude`.
package/dist/index.d.ts CHANGED
@@ -2590,6 +2590,44 @@ export declare interface Resolve {
2590
2590
  * ```
2591
2591
  */
2592
2592
  dedupe?: string[] | undefined;
2593
+ /**
2594
+ * Automatically resolve file extensions when importing modules. This means you can import files without explicitly writing their extensions.
2595
+ *
2596
+ * Default: `['.ts', '.tsx', '.mjs', '.js', '.jsx', '.json', '.cjs']`
2597
+ *
2598
+ * For example, if importing './index', Rsbuild will try to resolve using the following order:
2599
+ *
2600
+ * - `./index.ts`
2601
+ *
2602
+ * - `./index.tsx`
2603
+ *
2604
+ * - `./index.mjs`
2605
+ *
2606
+ * - `./index.js`
2607
+ *
2608
+ * - `./index.jsx`
2609
+ *
2610
+ * - `./index.json`
2611
+ *
2612
+ * - `./index.cjs`
2613
+ *
2614
+ * @remarks
2615
+ * The difference between `resolve.extensions` and `tools.rspack.resolve.extensions`:
2616
+ *
2617
+ * `resolve.extensions`: Completely overrides Rspeedy's default resolution.
2618
+ *
2619
+ * `tools.rspack.resolve.extensions`: Merges with the default configuration using [`webpack-merge`](https://github.com/survivejs/webpack-merge).
2620
+ *
2621
+ * @example
2622
+ * ```js
2623
+ * export default {
2624
+ * resolve: {
2625
+ * extensions: ['.ts', '.tsx', '.js'],
2626
+ * },
2627
+ * }
2628
+ * ```
2629
+ */
2630
+ extensions?: string[] | undefined;
2593
2631
  }
2594
2632
 
2595
2633
  export { RsbuildPlugin }
package/dist/index.js CHANGED
@@ -344,7 +344,8 @@ function toRsbuildConfig(config) {
344
344
  resolve: {
345
345
  alias: config.resolve?.alias,
346
346
  aliasStrategy: config.resolve?.aliasStrategy,
347
- dedupe: config.resolve?.dedupe
347
+ dedupe: config.resolve?.dedupe,
348
+ extensions: config.resolve?.extensions
348
349
  },
349
350
  source: {
350
351
  alias: config.source?.alias,
@@ -328,7 +328,8 @@ export const __webpack_modules__ = {
328
328
  resolve: {
329
329
  alias: config.resolve?.alias,
330
330
  aliasStrategy: config.resolve?.aliasStrategy,
331
- dedupe: config.resolve?.dedupe
331
+ dedupe: config.resolve?.dedupe,
332
+ extensions: config.resolve?.extensions
332
333
  },
333
334
  source: {
334
335
  alias: config.source?.alias,
@@ -320,7 +320,8 @@ export const __webpack_modules__ = {
320
320
  resolve: {
321
321
  alias: config.resolve?.alias,
322
322
  aliasStrategy: config.resolve?.aliasStrategy,
323
- dedupe: config.resolve?.dedupe
323
+ dedupe: config.resolve?.dedupe,
324
+ extensions: config.resolve?.extensions
324
325
  },
325
326
  source: {
326
327
  alias: config.source?.alias,
@@ -266,7 +266,8 @@ export const __webpack_modules__ = {
266
266
  resolve: {
267
267
  alias: config.resolve?.alias,
268
268
  aliasStrategy: config.resolve?.aliasStrategy,
269
- dedupe: config.resolve?.dedupe
269
+ dedupe: config.resolve?.dedupe,
270
+ extensions: config.resolve?.extensions
270
271
  },
271
272
  source: {
272
273
  alias: config.source?.alias,
@@ -268,7 +268,8 @@ export const __webpack_modules__ = {
268
268
  resolve: {
269
269
  alias: config.resolve?.alias,
270
270
  aliasStrategy: config.resolve?.aliasStrategy,
271
- dedupe: config.resolve?.dedupe
271
+ dedupe: config.resolve?.dedupe,
272
+ extensions: config.resolve?.extensions
272
273
  },
273
274
  source: {
274
275
  alias: config.source?.alias,