@lynx-js/rspeedy-canary 0.11.2-canary-20250915-59a0d600 → 0.11.2

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,17 +1,19 @@
1
1
  # @lynx-js/rspeedy
2
2
 
3
- ## 0.11.2-canary-20250915090032-59a0d600e111d2ae5136f5ee7cd768bc38de018b
3
+ ## 0.11.2
4
4
 
5
5
  ### Patch Changes
6
6
 
7
+ - Support `server.proxy`. ([#1745](https://github.com/lynx-family/lynx-stack/pull/1745))
8
+
7
9
  - Support `command` and `env` parameters in the function exported by `lynx.config.js`. ([#1669](https://github.com/lynx-family/lynx-stack/pull/1669))
8
10
 
9
11
  ```js
10
- import { defineConfig } from "@lynx-js/rspeedy";
12
+ import { defineConfig } from '@lynx-js/rspeedy'
11
13
 
12
14
  export default defineConfig(({ command, env }) => {
13
- const isBuild = command === "build";
14
- const isTest = env === "test";
15
+ const isBuild = command === 'build'
16
+ const isTest = env === 'test'
15
17
 
16
18
  return {
17
19
  output: {
@@ -20,8 +22,8 @@
20
22
  performance: {
21
23
  buildCache: isBuild,
22
24
  },
23
- };
24
- });
25
+ }
26
+ })
25
27
  ```
26
28
 
27
29
  - Support `resolve.dedupe`. ([#1671](https://github.com/lynx-family/lynx-stack/pull/1671))
@@ -29,36 +31,36 @@
29
31
  This is useful when having multiple duplicated packages in the bundle:
30
32
 
31
33
  ```js
32
- import { defineConfig } from "@lynx-js/rspeedy";
34
+ import { defineConfig } from '@lynx-js/rspeedy'
33
35
 
34
36
  export default defineConfig({
35
37
  resolve: {
36
- dedupe: ["tslib"],
38
+ dedupe: ['tslib'],
37
39
  },
38
- });
40
+ })
39
41
  ```
40
42
 
41
43
  - Support `resolve.aliasStrategy` for controlling priority between `tsconfig.json` paths and `resolve.alias` ([#1722](https://github.com/lynx-family/lynx-stack/pull/1722))
42
44
 
43
45
  ```js
44
- import { defineConfig } from "@lynx-js/rspeedy";
46
+ import { defineConfig } from '@lynx-js/rspeedy'
45
47
 
46
48
  export default defineConfig({
47
49
  resolve: {
48
50
  alias: {
49
- "@": "./src",
51
+ '@': './src',
50
52
  },
51
53
  // 'prefer-tsconfig' (default): tsconfig.json paths take priority
52
54
  // 'prefer-alias': resolve.alias takes priority
53
- aliasStrategy: "prefer-alias",
55
+ aliasStrategy: 'prefer-alias',
54
56
  },
55
- });
57
+ })
56
58
  ```
57
59
 
58
60
  - Bump Rsbuild v1.5.4 with Rspack v1.5.2. ([#1644](https://github.com/lynx-family/lynx-stack/pull/1644))
59
61
 
60
62
  - Updated dependencies [[`d7c5da3`](https://github.com/lynx-family/lynx-stack/commit/d7c5da329caddfb12ed77159fb8b1b8f38717cff)]:
61
- - @lynx-js/chunk-loading-webpack-plugin@0.3.3-canary-20250915090032-59a0d600e111d2ae5136f5ee7cd768bc38de018b
63
+ - @lynx-js/chunk-loading-webpack-plugin@0.3.3
62
64
  - @lynx-js/cache-events-webpack-plugin@0.0.2
63
65
 
64
66
  ## 0.11.1
@@ -72,7 +74,7 @@
72
74
  - Add `output.dataUriLimit.*` for fine-grained control of asset inlining. ([#1648](https://github.com/lynx-family/lynx-stack/pull/1648))
73
75
 
74
76
  ```js
75
- import { defineConfig } from "@lynx-js/rspeedy";
77
+ import { defineConfig } from '@lynx-js/rspeedy'
76
78
 
77
79
  export default defineConfig({
78
80
  output: {
@@ -81,7 +83,7 @@
81
83
  media: 0,
82
84
  },
83
85
  },
84
- });
86
+ })
85
87
  ```
86
88
 
87
89
  ## 0.11.0
@@ -201,28 +203,28 @@
201
203
 
202
204
  ```ts
203
205
  type InlineChunkTestFunction = (params: {
204
- size: number;
205
- name: string;
206
- }) => boolean;
206
+ size: number
207
+ name: string
208
+ }) => boolean
207
209
 
208
- type InlineChunkTest = RegExp | InlineChunkTestFunction;
210
+ type InlineChunkTest = RegExp | InlineChunkTestFunction
209
211
 
210
212
  type InlineChunkConfig =
211
213
  | boolean
212
214
  | InlineChunkTest
213
- | { enable?: boolean | "auto"; test: InlineChunkTest };
215
+ | { enable?: boolean | 'auto', test: InlineChunkTest }
214
216
  ```
215
217
 
216
218
  ```ts
217
- import { defineConfig } from "@lynx-js/rspeedy";
219
+ import { defineConfig } from '@lynx-js/rspeedy'
218
220
 
219
221
  export default defineConfig({
220
222
  output: {
221
223
  inlineScripts: ({ name, size }) => {
222
- return name.includes("foo") && size < 1000;
224
+ return name.includes('foo') && size < 1000
223
225
  },
224
226
  },
225
- });
227
+ })
226
228
  ```
227
229
 
228
230
  - docs: remove chunks: 'all' in comments ([#1168](https://github.com/lynx-family/lynx-stack/pull/1168))
@@ -265,13 +267,13 @@
265
267
  example:
266
268
 
267
269
  ```js
268
- import { defineConfig } from "@lynx-js/rspeedy";
270
+ import { defineConfig } from '@lynx-js/rspeedy'
269
271
 
270
272
  export default defineConfig({
271
273
  output: {
272
274
  inlineScripts: false,
273
275
  },
274
- });
276
+ })
275
277
  ```
276
278
 
277
279
  - Bump Rsbuild v1.3.21 with Rspack v1.3.11. ([#863](https://github.com/lynx-family/lynx-stack/pull/863))
@@ -291,12 +293,12 @@
291
293
  example:
292
294
 
293
295
  ```js
294
- import { defineConfig } from "@lynx-js/rspeedy";
296
+ import { defineConfig } from '@lynx-js/rspeedy'
295
297
  export default defineConfig({
296
298
  source: {
297
- preEntry: "./src/polyfill.ts",
299
+ preEntry: './src/polyfill.ts',
298
300
  },
299
- });
301
+ })
300
302
  ```
301
303
 
302
304
  - Bump Rsbuild v1.3.20 with Rspack v1.3.10. ([#799](https://github.com/lynx-family/lynx-stack/pull/799))
@@ -307,17 +309,17 @@
307
309
 
308
310
  ```js
309
311
  export const myPlugin = {
310
- name: "my-plugin",
312
+ name: 'my-plugin',
311
313
  setup(api) {
312
- const { callerName } = api.context;
314
+ const { callerName } = api.context
313
315
 
314
- if (callerName === "rslib") {
316
+ if (callerName === 'rslib') {
315
317
  // ...
316
- } else if (callerName === "rspeedy") {
318
+ } else if (callerName === 'rspeedy') {
317
319
  // ...
318
320
  }
319
321
  },
320
- };
322
+ }
321
323
  ```
322
324
 
323
325
  - Support `performance.buildCache`. ([#766](https://github.com/lynx-family/lynx-stack/pull/766))
@@ -340,7 +342,7 @@
340
342
  Set `tools.rsdoctor.experiments.enableNativePlugin` to `false` to use the old JS plugin.
341
343
 
342
344
  ```js
343
- import { defineConfig } from "@lynx-js/rspeedy";
345
+ import { defineConfig } from '@lynx-js/rspeedy'
344
346
 
345
347
  export default defineConfig({
346
348
  tools: {
@@ -350,7 +352,7 @@
350
352
  },
351
353
  },
352
354
  },
353
- });
355
+ })
354
356
  ```
355
357
 
356
358
  See [Rsdoctor - 1.0](https://rsdoctor.dev/blog/release/release-note-1_0#-faster-analysis) for more details.
@@ -482,12 +484,12 @@
482
484
  example:
483
485
 
484
486
  ```js
485
- import { defineConfig } from "@lynx-js/rspeedy";
487
+ import { defineConfig } from '@lynx-js/rspeedy'
486
488
  export default defineConfig({
487
489
  server: {
488
- base: "/dist",
490
+ base: '/dist',
489
491
  },
490
- });
492
+ })
491
493
  ```
492
494
 
493
495
  - Updated dependencies [[`b026c8b`](https://github.com/lynx-family/lynx-stack/commit/b026c8bdcbf7bdcda73e170477297213b447d876)]:
@@ -540,11 +542,11 @@
540
542
  You can switch to other tools by using:
541
543
 
542
544
  ```js
543
- import { defineConfig } from "@lynx-js/rspeedy";
545
+ import { defineConfig } from '@lynx-js/rspeedy'
544
546
  import {
545
547
  CssMinimizerWebpackPlugin,
546
548
  pluginCssMinimizer,
547
- } from "@rsbuild/plugin-css-minimizer";
549
+ } from '@rsbuild/plugin-css-minimizer'
548
550
 
549
551
  export default defineConfig({
550
552
  plugins: [
@@ -557,7 +559,7 @@
557
559
  },
558
560
  }),
559
561
  ],
560
- });
562
+ })
561
563
  ```
562
564
 
563
565
  See [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) for details.
@@ -567,8 +569,8 @@
567
569
  You can use custom options with [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer):
568
570
 
569
571
  ```js
570
- import { defineConfig } from "@lynx-js/rspeedy";
571
- import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
572
+ import { defineConfig } from '@lynx-js/rspeedy'
573
+ import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
572
574
 
573
575
  export default defineConfig({
574
576
  plugins: [
@@ -580,7 +582,7 @@
580
582
  },
581
583
  }),
582
584
  ],
583
- });
585
+ })
584
586
  ```
585
587
 
586
588
  ## 0.7.1
@@ -600,7 +602,7 @@
600
602
  You may turn it off using `output.minify.css: false`:
601
603
 
602
604
  ```js
603
- import { defineConfig } from "@lynx-js/rspeedy";
605
+ import { defineConfig } from '@lynx-js/rspeedy'
604
606
 
605
607
  export default defineConfig({
606
608
  output: {
@@ -608,18 +610,18 @@
608
610
  css: false,
609
611
  },
610
612
  },
611
- });
613
+ })
612
614
  ```
613
615
 
614
616
  Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
615
617
 
616
618
  ```js
617
- import { defineConfig } from "@lynx-js/rspeedy";
618
- import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
619
+ import { defineConfig } from '@lynx-js/rspeedy'
620
+ import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
619
621
 
620
622
  export default defineConfig({
621
623
  plugins: [pluginCssMinimizer()],
622
- });
624
+ })
623
625
  ```
624
626
 
625
627
  - 525554c: **BREAKING CHANGE**: Bump ts-blank-space to ^0.6.0.
@@ -646,22 +648,22 @@
646
648
  - The new `type: 'reload-server'` will restart the development server when it detects changes in the specified files.
647
649
 
648
650
  ```js
649
- import { defineConfig } from "@lynx-js/rspeedy";
651
+ import { defineConfig } from '@lynx-js/rspeedy'
650
652
 
651
653
  export default defineConfig({
652
654
  dev: {
653
655
  watchFiles: [
654
656
  {
655
- type: "reload-server",
656
- paths: ["public/**/*.txt"],
657
+ type: 'reload-server',
658
+ paths: ['public/**/*.txt'],
657
659
  },
658
660
  {
659
- type: "reload-page",
660
- paths: ["public/**/*.json"],
661
+ type: 'reload-page',
662
+ paths: ['public/**/*.json'],
661
663
  },
662
664
  ],
663
665
  },
664
- });
666
+ })
665
667
  ```
666
668
 
667
669
  - be9b003: Add `source.exclude`.
package/dist/index.d.ts CHANGED
@@ -21,6 +21,7 @@ import type { DistPathConfig } from '@rsbuild/core';
21
21
  import type { InlineChunkConfig } from '@rsbuild/core';
22
22
  import { logger } from '@rsbuild/core';
23
23
  import type { PerformanceConfig } from '@rsbuild/core';
24
+ import type { ProxyConfig } from '@rsbuild/core';
24
25
  import type { RsbuildConfig } from '@rsbuild/core';
25
26
  import type { RsbuildInstance } from '@rsbuild/core';
26
27
  import { RsbuildPlugin } from '@rsbuild/core';
@@ -2698,6 +2699,24 @@ export declare interface Server {
2698
2699
  * ```
2699
2700
  */
2700
2701
  port?: number | undefined;
2702
+ /**
2703
+ * Configure proxy rules for the dev server or preview server to proxy requests to the specified service.
2704
+ *
2705
+ * @example
2706
+ *
2707
+ * ```js
2708
+ * export default {
2709
+ * server: {
2710
+ * proxy: {
2711
+ * // http://localhost:3000/api -> http://localhost:3000/api
2712
+ * // http://localhost:3000/api/foo -> http://localhost:3000/api/foo
2713
+ * '/api': 'http://localhost:3000',
2714
+ * },
2715
+ * },
2716
+ * }
2717
+ * ```
2718
+ */
2719
+ proxy?: ProxyConfig | undefined;
2701
2720
  /**
2702
2721
  * When a port is occupied, Rspeedy will automatically increment the port number until an available port is found.
2703
2722
  *
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.1"
111
+ rE: "0.11.2"
112
112
  };
113
113
  const version = package_namespaceObject.rE;
114
114
  const rspackVersion = core_.rspack.rspackVersion;
@@ -363,6 +363,7 @@ function toRsbuildConfig(config) {
363
363
  headers: config.server?.headers,
364
364
  host: config.server?.host,
365
365
  port: config.server?.port,
366
+ proxy: config.server?.proxy,
366
367
  strictPort: config.server?.strictPort
367
368
  },
368
369
  plugins: config.plugins,
@@ -347,6 +347,7 @@ export const __webpack_modules__ = {
347
347
  headers: config.server?.headers,
348
348
  host: config.server?.host,
349
349
  port: config.server?.port,
350
+ proxy: config.server?.proxy,
350
351
  strictPort: config.server?.strictPort
351
352
  },
352
353
  plugins: config.plugins,
@@ -41,7 +41,7 @@ export const __webpack_modules__ = {
41
41
  });
42
42
  var core_ = __webpack_require__("@rsbuild/core");
43
43
  var package_namespaceObject = {
44
- rE: "0.11.1"
44
+ rE: "0.11.2"
45
45
  };
46
46
  const version = package_namespaceObject.rE;
47
47
  const rspackVersion = core_.rspack.rspackVersion;
@@ -339,6 +339,7 @@ export const __webpack_modules__ = {
339
339
  headers: config.server?.headers,
340
340
  host: config.server?.host,
341
341
  port: config.server?.port,
342
+ proxy: config.server?.proxy,
342
343
  strictPort: config.server?.strictPort
343
344
  },
344
345
  plugins: config.plugins,
@@ -285,6 +285,7 @@ export const __webpack_modules__ = {
285
285
  headers: config.server?.headers,
286
286
  host: config.server?.host,
287
287
  port: config.server?.port,
288
+ proxy: config.server?.proxy,
288
289
  strictPort: config.server?.strictPort
289
290
  },
290
291
  plugins: config.plugins,
@@ -287,6 +287,7 @@ export const __webpack_modules__ = {
287
287
  headers: config.server?.headers,
288
288
  host: config.server?.host,
289
289
  port: config.server?.port,
290
+ proxy: config.server?.proxy,
290
291
  strictPort: config.server?.strictPort
291
292
  },
292
293
  plugins: config.plugins,