@lynx-js/rspeedy 0.14.0 → 0.14.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 +16 -2
- package/dist/index.d.ts +259 -168
- package/dist/src_cli_main_ts.js +1 -1
- package/dist/src_index_ts.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @lynx-js/rspeedy
|
|
2
2
|
|
|
3
|
+
## 0.14.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @lynx-js/web-rsbuild-server-middleware@0.20.2
|
|
9
|
+
|
|
10
|
+
## 0.14.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies []:
|
|
15
|
+
- @lynx-js/web-rsbuild-server-middleware@0.20.1
|
|
16
|
+
|
|
3
17
|
## 0.14.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -514,7 +528,7 @@
|
|
|
514
528
|
|
|
515
529
|
- Add `callerName` option to `createRspeedy`. ([#757](https://github.com/lynx-family/lynx-stack/pull/757))
|
|
516
530
|
|
|
517
|
-
It can be accessed by Rsbuild plugins through [`api.context.callerName`](https://rsbuild.
|
|
531
|
+
It can be accessed by Rsbuild plugins through [`api.context.callerName`](https://rsbuild.rs/api/javascript-api/instance#contextcallername), and execute different logic based on this identifier.
|
|
518
532
|
|
|
519
533
|
```js
|
|
520
534
|
export const myPlugin = {
|
|
@@ -645,7 +659,7 @@
|
|
|
645
659
|
|
|
646
660
|
- Support `output.distPath.*`. ([#366](https://github.com/lynx-family/lynx-stack/pull/366))
|
|
647
661
|
|
|
648
|
-
See [Rsbuild - distPath](https://rsbuild.
|
|
662
|
+
See [Rsbuild - distPath](https://rsbuild.rs/config/output/dist-path) for all available options.
|
|
649
663
|
|
|
650
664
|
- Support `performance.printFileSize` ([#336](https://github.com/lynx-family/lynx-stack/pull/336))
|
|
651
665
|
|
package/dist/index.d.ts
CHANGED
|
@@ -75,20 +75,7 @@ export declare interface BuildCache {
|
|
|
75
75
|
* An array of files containing build dependencies.
|
|
76
76
|
* Rspack will use the hash of each of these files to invalidate the persistent cache.
|
|
77
77
|
*
|
|
78
|
-
* @
|
|
79
|
-
*
|
|
80
|
-
* Rspeedy will use the following configuration files as the default build dependencies:
|
|
81
|
-
*
|
|
82
|
-
* - `package.json`
|
|
83
|
-
*
|
|
84
|
-
* - `tsconfig.json` (or `source.tsconfigPath`)
|
|
85
|
-
*
|
|
86
|
-
* - `.env`, `.env.*`
|
|
87
|
-
*
|
|
88
|
-
* - `tailwindcss.config.*`
|
|
89
|
-
*
|
|
90
|
-
* When using Rspeedy CLI, it will also automatically add
|
|
91
|
-
* `lynx.config.js` to the build dependencies.
|
|
78
|
+
* @defaultValue `['package.json', 'tsconfig.json' (or source.tsconfigPath), '.env', '.env.*', 'tailwindcss.config.*']`; when using the Rspeedy CLI with `performance.buildCache` enabled, the loaded `lynx.config.*` file is also added.
|
|
92
79
|
*
|
|
93
80
|
* @example
|
|
94
81
|
*
|
|
@@ -118,9 +105,11 @@ export declare interface ChunkSplit {
|
|
|
118
105
|
/**
|
|
119
106
|
* The ChunkSplitting strategy.
|
|
120
107
|
*
|
|
108
|
+
* @defaultValue In Rsbuild's default chunk splitting behavior, the strategy is `'split-by-experience'`.
|
|
109
|
+
*
|
|
121
110
|
* @remarks
|
|
122
111
|
*
|
|
123
|
-
* - `split-by-experience`(default): an empirical splitting strategy, automatically splits some commonly used npm packages into chunks of moderate size.
|
|
112
|
+
* - `split-by-experience`(Rsbuild default): an empirical splitting strategy, automatically splits some commonly used npm packages into chunks of moderate size.
|
|
124
113
|
*
|
|
125
114
|
* - `split-by-module`: split by NPM package granularity, each NPM package corresponds to a chunk.
|
|
126
115
|
*
|
|
@@ -168,6 +157,8 @@ export declare interface ChunkSplit {
|
|
|
168
157
|
/**
|
|
169
158
|
* Custom Rspack chunk splitting config can be specified.
|
|
170
159
|
*
|
|
160
|
+
* @defaultValue undefined
|
|
161
|
+
*
|
|
171
162
|
* @example
|
|
172
163
|
*
|
|
173
164
|
* - Split `@lynx-js/react` and `react-router` into chunk `lib-react`.
|
|
@@ -210,7 +201,9 @@ export declare interface ChunkSplitBySize {
|
|
|
210
201
|
*/
|
|
211
202
|
strategy: 'split-by-size';
|
|
212
203
|
/**
|
|
213
|
-
* The minimum size of a chunk, unit in bytes.
|
|
204
|
+
* The minimum size of a chunk, unit in bytes.
|
|
205
|
+
*
|
|
206
|
+
* @defaultValue 10000
|
|
214
207
|
*
|
|
215
208
|
* @example
|
|
216
209
|
*
|
|
@@ -229,7 +222,9 @@ export declare interface ChunkSplitBySize {
|
|
|
229
222
|
*/
|
|
230
223
|
minSize?: number | undefined;
|
|
231
224
|
/**
|
|
232
|
-
* The maximum size of a chunk, unit in bytes.
|
|
225
|
+
* The maximum size of a chunk, unit in bytes.
|
|
226
|
+
*
|
|
227
|
+
* @defaultValue `Number.POSITIVE_INFINITY`
|
|
233
228
|
*
|
|
234
229
|
* @example
|
|
235
230
|
*
|
|
@@ -249,6 +244,8 @@ export declare interface ChunkSplitBySize {
|
|
|
249
244
|
maxSize?: number | undefined;
|
|
250
245
|
/**
|
|
251
246
|
* {@inheritdoc ChunkSplit.override}
|
|
247
|
+
*
|
|
248
|
+
* @defaultValue undefined
|
|
252
249
|
*/
|
|
253
250
|
override?: Rspack.Configuration extends {
|
|
254
251
|
optimization?: {
|
|
@@ -270,6 +267,8 @@ export declare interface ChunkSplitCustom {
|
|
|
270
267
|
/**
|
|
271
268
|
* {@inheritdoc ChunkSplit.override}
|
|
272
269
|
*
|
|
270
|
+
* @defaultValue undefined
|
|
271
|
+
*
|
|
273
272
|
* @example
|
|
274
273
|
*
|
|
275
274
|
* - Split `@lynx-js/react` and `react-router` into chunk `lib-react`.
|
|
@@ -309,11 +308,15 @@ export declare interface ChunkSplitCustom {
|
|
|
309
308
|
export declare interface Config {
|
|
310
309
|
/**
|
|
311
310
|
* The {@link Dev} option is used to control the behavior related with development. Including: HMR, DevServer, etc.
|
|
311
|
+
*
|
|
312
|
+
* @defaultValue undefined
|
|
312
313
|
*/
|
|
313
314
|
dev?: Dev | undefined;
|
|
314
315
|
/**
|
|
315
316
|
* The {@link Config.environments} option is used to set the output environment.
|
|
316
317
|
*
|
|
318
|
+
* @defaultValue When this option is unset, Rspeedy passes `{ lynx: {} }` to Rsbuild.
|
|
319
|
+
*
|
|
317
320
|
* @remarks
|
|
318
321
|
*
|
|
319
322
|
* Normally you don't need this if you are not using Lynx for Web.
|
|
@@ -358,29 +361,13 @@ export declare interface Config {
|
|
|
358
361
|
/**
|
|
359
362
|
* Specify the build mode for Rsbuild and Rspack, as each mode has different default behavior and optimizations.
|
|
360
363
|
*
|
|
361
|
-
* @
|
|
362
|
-
*
|
|
363
|
-
* The default value of mode depends on the `process.env.NODE_ENV` environment variable:
|
|
364
|
-
*
|
|
365
|
-
* - If `NODE_ENV` is production, the default value is production.
|
|
366
|
-
*
|
|
367
|
-
* - If `NODE_ENV` is development, the default value is development.
|
|
368
|
-
*
|
|
369
|
-
* - If `NODE_ENV` has any other value, the default value is none.
|
|
370
|
-
*
|
|
371
|
-
* - If you set the value of mode, the value of `NODE_ENV` will be ignored.
|
|
372
|
-
*
|
|
373
|
-
* When using Rspeedy's CLI:
|
|
374
|
-
*
|
|
375
|
-
* - `rspeedy dev` and `rspeedy preview` will set the default values of `NODE_ENV` and `mode` to `'development'`.
|
|
376
|
-
*
|
|
377
|
-
* - `rspeedy build` will set the default values of `NODE_ENV` and `mode` to `'production'`.
|
|
364
|
+
* @defaultValue Depends on `process.env.NODE_ENV`: `'production'` when `NODE_ENV` is `'production'`, `'development'` when `NODE_ENV` is `'development'`, and `'none'` otherwise. When using Rspeedy's CLI, `rspeedy dev` and `rspeedy preview` default to `'development'`, while `rspeedy build` defaults to `'production'`.
|
|
378
365
|
*
|
|
379
366
|
* @example
|
|
380
367
|
*
|
|
381
368
|
* If the value of `mode` is `'development'`:
|
|
382
369
|
*
|
|
383
|
-
* - Enable HMR and register the {@link https://rspack.
|
|
370
|
+
* - Enable HMR and register the {@link https://rspack.rs/plugins/webpack/hot-module-replacement-plugin | HotModuleReplacementPlugin}.
|
|
384
371
|
*
|
|
385
372
|
* - Generate JavaScript source maps, but do not generate CSS source maps. See {@link Output.sourceMap} for details.
|
|
386
373
|
*
|
|
@@ -396,7 +383,7 @@ export declare interface Config {
|
|
|
396
383
|
*
|
|
397
384
|
* If the value of `mode` is `'production'`:
|
|
398
385
|
*
|
|
399
|
-
* - Enable JavaScript code minification and register the {@link https://rspack.
|
|
386
|
+
* - Enable JavaScript code minification and register the {@link https://rspack.rs/plugins/rspack/swc-js-minimizer-rspack-plugin | SwcJsMinimizerRspackPlugin}.
|
|
400
387
|
*
|
|
401
388
|
* - Generated JavaScript and CSS filenames will have hash suffixes, see {@link Output.filenameHash}.
|
|
402
389
|
*
|
|
@@ -415,33 +402,47 @@ export declare interface Config {
|
|
|
415
402
|
mode?: 'development' | 'production' | 'none' | undefined;
|
|
416
403
|
/**
|
|
417
404
|
* The {@link Output} option is used to set how and where should the bundles and assets output.
|
|
405
|
+
*
|
|
406
|
+
* @defaultValue undefined
|
|
418
407
|
*/
|
|
419
408
|
output?: Output | undefined;
|
|
420
409
|
/**
|
|
421
410
|
* The {@link Performance} option is used to optimize the build-time and runtime performance.
|
|
411
|
+
*
|
|
412
|
+
* @defaultValue undefined
|
|
422
413
|
*/
|
|
423
414
|
performance?: Performance | undefined;
|
|
424
415
|
/**
|
|
425
416
|
* The {@link Resolve} option is used to control the resolution behavior of Rspack.
|
|
417
|
+
*
|
|
418
|
+
* @defaultValue undefined
|
|
426
419
|
*/
|
|
427
420
|
resolve?: Resolve | undefined;
|
|
428
421
|
/**
|
|
429
422
|
* The {@link Server} option changes the behavior of dev-server.
|
|
423
|
+
*
|
|
424
|
+
* @defaultValue undefined
|
|
430
425
|
*/
|
|
431
426
|
server?: Server | undefined;
|
|
432
427
|
/**
|
|
433
428
|
* The {@link Source} option changes the behavior of source files.
|
|
429
|
+
*
|
|
430
|
+
* @defaultValue undefined
|
|
434
431
|
*/
|
|
435
432
|
source?: Source | undefined;
|
|
436
433
|
/**
|
|
437
434
|
* The {@link Tools} options changes the behavior of various building tools.
|
|
435
|
+
*
|
|
436
|
+
* @defaultValue undefined
|
|
438
437
|
*/
|
|
439
438
|
tools?: Tools | undefined;
|
|
440
439
|
/**
|
|
441
440
|
* The `plugins` option is used to customize the build process in a variety of ways.
|
|
442
441
|
*
|
|
442
|
+
* @defaultValue undefined
|
|
443
|
+
*
|
|
443
444
|
* @remarks
|
|
444
|
-
* Rspeedy
|
|
445
|
+
* Rspeedy uses the plugin APIs from {@link https://rsbuild.rs/plugins/dev/index | Rsbuild}. See the corresponding document for developing a plugin.
|
|
445
446
|
*/
|
|
446
447
|
plugins?: RsbuildPlugins | undefined;
|
|
447
448
|
}
|
|
@@ -455,6 +456,8 @@ export declare interface ConfigParams {
|
|
|
455
456
|
/**
|
|
456
457
|
* The value of `process.env['NODE_ENV']`
|
|
457
458
|
*
|
|
459
|
+
* @defaultValue When `loadConfig` evaluates a config function, this value is `process.env.NODE_ENV ?? 'production'`
|
|
460
|
+
*
|
|
458
461
|
* @remarks
|
|
459
462
|
* Common values include (non-exhaustive):
|
|
460
463
|
* - `'production'`
|
|
@@ -467,6 +470,8 @@ export declare interface ConfigParams {
|
|
|
467
470
|
/**
|
|
468
471
|
* The CLI command of Rspeedy.
|
|
469
472
|
*
|
|
473
|
+
* @defaultValue When `loadConfig` evaluates a config function, this value is `process.argv[2] ?? 'build'`
|
|
474
|
+
*
|
|
470
475
|
* @remarks
|
|
471
476
|
*
|
|
472
477
|
* Possible values:
|
|
@@ -525,9 +530,9 @@ export declare interface CreateRspeedyOptions {
|
|
|
525
530
|
*/
|
|
526
531
|
rspeedyConfig?: Config;
|
|
527
532
|
/**
|
|
528
|
-
* Rspeedy automatically loads the .env file by default, utilizing the [Rsbuild API](https://rsbuild.
|
|
533
|
+
* Rspeedy automatically loads the .env file by default, utilizing the [Rsbuild API](https://rsbuild.rs/api/javascript-api/core#load-env-variables).
|
|
529
534
|
* You can use the environment variables defined in the .env file within your code by accessing them via `import.meta.env.FOO` or `process.env.Foo`.
|
|
530
|
-
* @see https://rsbuild.
|
|
535
|
+
* @see https://rsbuild.rs/guide/advanced/env-vars#env-file
|
|
531
536
|
* @defaultValue true
|
|
532
537
|
*/
|
|
533
538
|
loadEnv?: CreateRsbuildOptions['loadEnv'];
|
|
@@ -535,7 +540,7 @@ export declare interface CreateRspeedyOptions {
|
|
|
535
540
|
* Only build specified environments.
|
|
536
541
|
* For example, passing `['lynx']` will only build the `lynx` environment.
|
|
537
542
|
* If not specified or passing an empty array, all environments will be built.
|
|
538
|
-
* @see https://rsbuild.
|
|
543
|
+
* @see https://rsbuild.rs/guide/advanced/environments#build-specified-environment
|
|
539
544
|
* @defaultValue []
|
|
540
545
|
*/
|
|
541
546
|
environment?: CreateRsbuildOptions['environment'];
|
|
@@ -585,10 +590,14 @@ export declare interface CreateRspeedyOptions {
|
|
|
585
590
|
export declare interface CssExtract {
|
|
586
591
|
/**
|
|
587
592
|
* {@inheritdoc @lynx-js/css-extract-webpack-plugin#LoaderOptions}
|
|
593
|
+
*
|
|
594
|
+
* @defaultValue undefined
|
|
588
595
|
*/
|
|
589
596
|
loaderOptions?: CssExtractRspackLoaderOptions | undefined;
|
|
590
597
|
/**
|
|
591
598
|
* {@inheritdoc @lynx-js/css-extract-webpack-plugin#CssExtractRspackPluginOptions}
|
|
599
|
+
*
|
|
600
|
+
* @defaultValue undefined
|
|
592
601
|
*/
|
|
593
602
|
pluginOptions?: CssExtractRspackPluginOptions | undefined;
|
|
594
603
|
}
|
|
@@ -632,6 +641,8 @@ export declare interface CssExtractRspackLoaderOptions {
|
|
|
632
641
|
* ```
|
|
633
642
|
*
|
|
634
643
|
* @public
|
|
644
|
+
*
|
|
645
|
+
* @defaultValue true
|
|
635
646
|
*/
|
|
636
647
|
esModule?: boolean | undefined;
|
|
637
648
|
}
|
|
@@ -644,10 +655,14 @@ export declare interface CssExtractRspackLoaderOptions {
|
|
|
644
655
|
export declare interface CssExtractRspackPluginOptions {
|
|
645
656
|
/**
|
|
646
657
|
* {@inheritdoc @lynx-js/css-extract-webpack-plugin#CssExtractRspackPluginOptions.ignoreOrder}
|
|
658
|
+
*
|
|
659
|
+
* @defaultValue undefined
|
|
647
660
|
*/
|
|
648
661
|
ignoreOrder?: boolean | undefined;
|
|
649
662
|
/**
|
|
650
663
|
* {@inheritdoc @lynx-js/css-extract-webpack-plugin#CssExtractRspackPluginOptions.pathinfo}
|
|
664
|
+
*
|
|
665
|
+
* @defaultValue undefined
|
|
651
666
|
*/
|
|
652
667
|
pathinfo?: boolean | undefined;
|
|
653
668
|
}
|
|
@@ -661,13 +676,9 @@ export declare interface CssLoader {
|
|
|
661
676
|
/**
|
|
662
677
|
* The option `importLoaders` allows you to configure how many loaders before `css-loader` should be applied to `@imported` resources and CSS modules imports.
|
|
663
678
|
*
|
|
664
|
-
* @
|
|
665
|
-
*
|
|
666
|
-
* The default value of `importLoaders` is:
|
|
679
|
+
* @defaultValue `1` when compiling CSS files and `2` when compiling Sass or Less files
|
|
667
680
|
*
|
|
668
|
-
*
|
|
669
|
-
*
|
|
670
|
-
* - `2` when compiling Sass or Less files
|
|
681
|
+
* @remarks
|
|
671
682
|
*
|
|
672
683
|
* See {@link https://github.com/webpack-contrib/css-loader?tab=readme-ov-file#importloaders | css-loader#import-loaders} for details.
|
|
673
684
|
*/
|
|
@@ -675,6 +686,8 @@ export declare interface CssLoader {
|
|
|
675
686
|
/**
|
|
676
687
|
* The {@link CssLoaderModules | cssLoader.modules} option enables/disables the CSS Modules specification and setup basic behavior.
|
|
677
688
|
*
|
|
689
|
+
* @defaultValue Enables CSS Modules with automatic `*.module.*` detection, camelCase exports, `namedExport: false`, and `localIdentName` inherited from `output.cssModules.localIdentName`.
|
|
690
|
+
*
|
|
678
691
|
* @example
|
|
679
692
|
*
|
|
680
693
|
* Using `false` value to increase performance because we avoid parsing CSS Modules features, it will be useful for developers who use vanilla css or use other technologies.
|
|
@@ -736,19 +749,27 @@ export declare interface CssLoader {
|
|
|
736
749
|
export declare interface CssLoaderModules {
|
|
737
750
|
/**
|
|
738
751
|
* {@inheritdoc CssModules.auto}
|
|
752
|
+
*
|
|
753
|
+
* @defaultValue true
|
|
739
754
|
*/
|
|
740
755
|
auto?: boolean | RegExp | ((filename: string) => boolean) | undefined;
|
|
741
756
|
/**
|
|
742
757
|
* {@inheritdoc CssModules.exportLocalsConvention}
|
|
758
|
+
*
|
|
759
|
+
* @defaultValue `'camelCase'`
|
|
743
760
|
*/
|
|
744
761
|
exportLocalsConvention?: CssModuleLocalsConvention | undefined;
|
|
745
762
|
/**
|
|
746
763
|
* {@inheritdoc CssModules.localIdentName}
|
|
764
|
+
*
|
|
765
|
+
* @defaultValue `'[local]-[hash:base64:6]'`
|
|
747
766
|
*/
|
|
748
767
|
localIdentName?: string | undefined;
|
|
749
768
|
/**
|
|
750
769
|
* Enables/disables ES modules named export for locals.
|
|
751
770
|
*
|
|
771
|
+
* @defaultValue false
|
|
772
|
+
*
|
|
752
773
|
* @example
|
|
753
774
|
*
|
|
754
775
|
* - `style.css`
|
|
@@ -799,6 +820,8 @@ export declare interface CssModules {
|
|
|
799
820
|
/**
|
|
800
821
|
* The `auto` option allows CSS modules to be automatically enabled based on their filenames.
|
|
801
822
|
*
|
|
823
|
+
* @defaultValue true
|
|
824
|
+
*
|
|
802
825
|
* @remarks
|
|
803
826
|
*
|
|
804
827
|
* Given the various `auto` values, the behavior is described as follows:
|
|
@@ -834,6 +857,8 @@ export declare interface CssModules {
|
|
|
834
857
|
/**
|
|
835
858
|
* Allows exporting names from global class names, so you can use them via import.
|
|
836
859
|
*
|
|
860
|
+
* @defaultValue false
|
|
861
|
+
*
|
|
837
862
|
* @remarks
|
|
838
863
|
*
|
|
839
864
|
* See {@link https://github.com/webpack-contrib/css-loader?tab=readme-ov-file#exportglobals | css-loader#exportGlobals} for details.
|
|
@@ -842,6 +867,8 @@ export declare interface CssModules {
|
|
|
842
867
|
/**
|
|
843
868
|
* The style of exported class names.
|
|
844
869
|
*
|
|
870
|
+
* @defaultValue `'camelCase'`
|
|
871
|
+
*
|
|
845
872
|
* @remarks
|
|
846
873
|
*
|
|
847
874
|
* Given the various `exportLocalsConvention` values, the behavior is described as follows:
|
|
@@ -862,9 +889,9 @@ export declare interface CssModules {
|
|
|
862
889
|
/**
|
|
863
890
|
* Sets the format of the className generated by CSS Modules after compilation.
|
|
864
891
|
*
|
|
865
|
-
* @
|
|
892
|
+
* @defaultValue `'[local]-[hash:base64:6]'`
|
|
866
893
|
*
|
|
867
|
-
*
|
|
894
|
+
* @remarks
|
|
868
895
|
*
|
|
869
896
|
* Available placeholders:
|
|
870
897
|
*
|
|
@@ -922,6 +949,8 @@ export declare interface Decorators {
|
|
|
922
949
|
/**
|
|
923
950
|
* Specify the decorator syntax version to be used.
|
|
924
951
|
*
|
|
952
|
+
* @defaultValue `'2022-03'`
|
|
953
|
+
*
|
|
925
954
|
* @remarks
|
|
926
955
|
*
|
|
927
956
|
* If you want to know the differences between different decorators versions, you can refer to: {@link https://github.com/tc39/proposal-decorators?tab=readme-ov-file#how-does-this-proposal-compare-to-other-versions-of-decorators | How does this proposal compare to other versions of decorators?}
|
|
@@ -1091,9 +1120,14 @@ export declare function defineConfig(config: (params: ConfigParams) => Promise<C
|
|
|
1091
1120
|
export declare interface Dev {
|
|
1092
1121
|
/**
|
|
1093
1122
|
* The {@link Dev.assetPrefix} is used to set the URL prefix for static assets during development.
|
|
1123
|
+
*
|
|
1124
|
+
* @defaultValue undefined
|
|
1125
|
+
*
|
|
1094
1126
|
* @remarks
|
|
1095
1127
|
*
|
|
1096
|
-
*
|
|
1128
|
+
* During `rspeedy dev`, if this option is not set to `false`, the dev plugin normalizes it to `http://<detected-host>:<port>/` and appends `server.base` when configured.
|
|
1129
|
+
*
|
|
1130
|
+
* The functionality of {@link Dev.assetPrefix} is basically the same as the {@link https://rspack.rs/config/output#outputpublicpath | output.publicPath}
|
|
1097
1131
|
* config in Rspack. With the following differences:
|
|
1098
1132
|
*
|
|
1099
1133
|
* - `dev.assetPrefix` only takes effect during development.
|
|
@@ -1150,14 +1184,16 @@ export declare interface Dev {
|
|
|
1150
1184
|
assetPrefix?: string | boolean | undefined;
|
|
1151
1185
|
/**
|
|
1152
1186
|
* Configuration of the development client.
|
|
1187
|
+
*
|
|
1188
|
+
* @defaultValue undefined
|
|
1153
1189
|
*/
|
|
1154
1190
|
client?: DevClient | undefined;
|
|
1155
1191
|
/**
|
|
1156
1192
|
* Whether to enable Hot Module Replacement (HMR).
|
|
1157
1193
|
*
|
|
1158
|
-
* @
|
|
1194
|
+
* @defaultValue true
|
|
1159
1195
|
*
|
|
1160
|
-
*
|
|
1196
|
+
* @remarks
|
|
1161
1197
|
*
|
|
1162
1198
|
* By default, Rspeedy uses HMR as the preferred method to update modules. If HMR is disabled or cannot be used in certain scenarios, it will automatically fallback to {@link Dev.liveReload}.
|
|
1163
1199
|
*
|
|
@@ -1196,7 +1232,7 @@ export declare interface Dev {
|
|
|
1196
1232
|
/**
|
|
1197
1233
|
* Whether to enable live reload functionality.
|
|
1198
1234
|
*
|
|
1199
|
-
*
|
|
1235
|
+
* @defaultValue true
|
|
1200
1236
|
*
|
|
1201
1237
|
* Live reload is used as a fallback when {@link Dev.hmr} is disabled or cannot be used in certain scenarios. When enabled, the page will automatically refresh when source files are changed.
|
|
1202
1238
|
*
|
|
@@ -1235,6 +1271,8 @@ export declare interface Dev {
|
|
|
1235
1271
|
/**
|
|
1236
1272
|
* Watch specified files and directories for changes. When a file change is detected, it can trigger a page reload or restart the dev server.
|
|
1237
1273
|
*
|
|
1274
|
+
* @defaultValue undefined
|
|
1275
|
+
*
|
|
1238
1276
|
* @example
|
|
1239
1277
|
*
|
|
1240
1278
|
* - Specify the files and directories watched for changes.
|
|
@@ -1272,6 +1310,8 @@ export declare interface Dev {
|
|
|
1272
1310
|
/**
|
|
1273
1311
|
* Used to control whether the build artifacts of the development environment are written to the disk.
|
|
1274
1312
|
*
|
|
1313
|
+
* @defaultValue true
|
|
1314
|
+
*
|
|
1275
1315
|
* @remarks
|
|
1276
1316
|
*
|
|
1277
1317
|
* This is bypassed to {@link https://github.com/webpack/webpack-dev-middleware?tab=readme-ov-file#writetodisk | `webpack-dev-middleware`}.
|
|
@@ -1297,7 +1337,7 @@ export declare interface Dev {
|
|
|
1297
1337
|
/**
|
|
1298
1338
|
* Whether to display progress bar during compilation.
|
|
1299
1339
|
*
|
|
1300
|
-
*
|
|
1340
|
+
* @defaultValue true
|
|
1301
1341
|
*
|
|
1302
1342
|
* @example
|
|
1303
1343
|
*
|
|
@@ -1345,9 +1385,7 @@ export declare interface DevClient {
|
|
|
1345
1385
|
/**
|
|
1346
1386
|
* The path to websocket.
|
|
1347
1387
|
*
|
|
1348
|
-
* @
|
|
1349
|
-
*
|
|
1350
|
-
* Defaults to `require.resolve('@lynx-js/websocket')`
|
|
1388
|
+
* @defaultValue `require.resolve('@lynx-js/websocket')`
|
|
1351
1389
|
*/
|
|
1352
1390
|
websocketTransport?: string | undefined;
|
|
1353
1391
|
}
|
|
@@ -1365,11 +1403,7 @@ export declare interface DistPath extends DistPathConfig {
|
|
|
1365
1403
|
*
|
|
1366
1404
|
* This option is never read and will be removed in the future version.
|
|
1367
1405
|
*
|
|
1368
|
-
* @
|
|
1369
|
-
*
|
|
1370
|
-
* Default value:
|
|
1371
|
-
*
|
|
1372
|
-
* - `'.rspeedy'`
|
|
1406
|
+
* @defaultValue `'.rspeedy'`
|
|
1373
1407
|
*/
|
|
1374
1408
|
intermediate?: string | undefined;
|
|
1375
1409
|
}
|
|
@@ -1444,7 +1478,7 @@ export declare type Entry = string | string[] | Record<string, string | string[]
|
|
|
1444
1478
|
* The `EntryDescription` describes a entry. It is useful when the project has multiple entries with different configuration.
|
|
1445
1479
|
*
|
|
1446
1480
|
* @remarks
|
|
1447
|
-
* It is similar with the {@link https://
|
|
1481
|
+
* It is similar with the {@link https://rspack.rs/config/entry#entry-description-object | Entry Description Object} of Rspack.
|
|
1448
1482
|
* But only a few properties that Lynx supports is allowed.
|
|
1449
1483
|
*
|
|
1450
1484
|
* @public
|
|
@@ -1453,23 +1487,21 @@ export declare interface EntryDescription {
|
|
|
1453
1487
|
/**
|
|
1454
1488
|
* The path to the entry module(s).
|
|
1455
1489
|
*
|
|
1456
|
-
* @remarks
|
|
1457
|
-
*
|
|
1458
|
-
* If no value is provided, the default value `src/index.js` will be used.
|
|
1459
|
-
*
|
|
1460
1490
|
* @defaultValue `'./src/index.js'`
|
|
1461
1491
|
*/
|
|
1462
1492
|
import?: string | string[] | undefined;
|
|
1463
1493
|
/**
|
|
1464
1494
|
* This is an important option when using on-demand-loading or loading external resources like images, files, etc. If an incorrect value is specified you'll receive 404 errors while loading these resources.
|
|
1465
1495
|
*
|
|
1496
|
+
* @defaultValue undefined
|
|
1497
|
+
*
|
|
1466
1498
|
* @see https://webpack.js.org/configuration/output/#outputpublicpath
|
|
1467
1499
|
*/
|
|
1468
1500
|
publicPath?: string | undefined;
|
|
1469
1501
|
}
|
|
1470
1502
|
|
|
1471
1503
|
/**
|
|
1472
|
-
* The exposed API of Rspeedy. Can be used in Rsbuild plugin with {@link https://rsbuild.
|
|
1504
|
+
* The exposed API of Rspeedy. Can be used in Rsbuild plugin with {@link https://rsbuild.rs/plugins/dev/core#apiuseexposed | api.useExposed}.
|
|
1473
1505
|
*
|
|
1474
1506
|
* @public
|
|
1475
1507
|
*
|
|
@@ -1522,11 +1554,9 @@ export declare interface Filename {
|
|
|
1522
1554
|
/**
|
|
1523
1555
|
* The name of the bundle files.
|
|
1524
1556
|
*
|
|
1525
|
-
* @
|
|
1526
|
-
*
|
|
1527
|
-
* Default values:
|
|
1557
|
+
* @defaultValue `'[name].[platform].bundle'`
|
|
1528
1558
|
*
|
|
1529
|
-
*
|
|
1559
|
+
* @remarks
|
|
1530
1560
|
*
|
|
1531
1561
|
* The following placeholder is supported:
|
|
1532
1562
|
*
|
|
@@ -1574,11 +1604,9 @@ export declare interface Filename {
|
|
|
1574
1604
|
*
|
|
1575
1605
|
* Use {@link Filename.bundle} instead.
|
|
1576
1606
|
*
|
|
1577
|
-
* @
|
|
1578
|
-
*
|
|
1579
|
-
* Default values:
|
|
1607
|
+
* @defaultValue `'[name].[platform].bundle'`
|
|
1580
1608
|
*
|
|
1581
|
-
*
|
|
1609
|
+
* @remarks
|
|
1582
1610
|
*
|
|
1583
1611
|
* The following placeholder is supported:
|
|
1584
1612
|
*
|
|
@@ -1621,12 +1649,7 @@ export declare interface Filename {
|
|
|
1621
1649
|
/**
|
|
1622
1650
|
* The name of the JavaScript files.
|
|
1623
1651
|
*
|
|
1624
|
-
* @
|
|
1625
|
-
*
|
|
1626
|
-
* Default values:
|
|
1627
|
-
*
|
|
1628
|
-
* - Development: `'[name].js'`
|
|
1629
|
-
* - Production: `'[name].[contenthash:8].js'`
|
|
1652
|
+
* @defaultValue `'[name].js'` in development, `'[name].[contenthash:8].js'` in production web builds, and `'[name].js'` in production node builds
|
|
1630
1653
|
*
|
|
1631
1654
|
* @example
|
|
1632
1655
|
*
|
|
@@ -1655,11 +1678,7 @@ export declare interface Filename {
|
|
|
1655
1678
|
/**
|
|
1656
1679
|
* The name of the CSS files.
|
|
1657
1680
|
*
|
|
1658
|
-
* @
|
|
1659
|
-
*
|
|
1660
|
-
* Default values:
|
|
1661
|
-
*
|
|
1662
|
-
* - `'[name].css'`
|
|
1681
|
+
* @defaultValue `'[name]/[name].css'`
|
|
1663
1682
|
*
|
|
1664
1683
|
* @example
|
|
1665
1684
|
*
|
|
@@ -1688,61 +1707,37 @@ export declare interface Filename {
|
|
|
1688
1707
|
/**
|
|
1689
1708
|
* The name of the SVG images.
|
|
1690
1709
|
*
|
|
1691
|
-
* @
|
|
1692
|
-
*
|
|
1693
|
-
* Default values:
|
|
1694
|
-
*
|
|
1695
|
-
* - `'[name].[contenthash:8].svg'`
|
|
1710
|
+
* @defaultValue `'[name].[contenthash:8].svg'`
|
|
1696
1711
|
*/
|
|
1697
1712
|
svg?: Rspack.AssetModuleFilename | undefined;
|
|
1698
1713
|
/**
|
|
1699
1714
|
* The name of the font files.
|
|
1700
1715
|
*
|
|
1701
|
-
* @
|
|
1702
|
-
*
|
|
1703
|
-
* Default values:
|
|
1704
|
-
*
|
|
1705
|
-
* - `'[name].[contenthash:8][ext]'`
|
|
1716
|
+
* @defaultValue `'[name].[contenthash:8][ext]'`
|
|
1706
1717
|
*/
|
|
1707
1718
|
font?: Rspack.AssetModuleFilename | undefined;
|
|
1708
1719
|
/**
|
|
1709
1720
|
* The name of non-SVG images.
|
|
1710
1721
|
*
|
|
1711
|
-
* @
|
|
1712
|
-
*
|
|
1713
|
-
* Default values:
|
|
1714
|
-
*
|
|
1715
|
-
* - `'[name].[contenthash:8][ext]'`
|
|
1722
|
+
* @defaultValue `'[name].[contenthash:8][ext]'`
|
|
1716
1723
|
*/
|
|
1717
1724
|
image?: Rspack.AssetModuleFilename | undefined;
|
|
1718
1725
|
/**
|
|
1719
1726
|
* The name of media assets, such as video.
|
|
1720
1727
|
*
|
|
1721
|
-
* @
|
|
1722
|
-
*
|
|
1723
|
-
* Default values:
|
|
1724
|
-
*
|
|
1725
|
-
* - `'[name].[contenthash:8][ext]'`
|
|
1728
|
+
* @defaultValue `'[name].[contenthash:8][ext]'`
|
|
1726
1729
|
*/
|
|
1727
1730
|
media?: Rspack.AssetModuleFilename | undefined;
|
|
1728
1731
|
/**
|
|
1729
1732
|
* The name of WebAssembly files.
|
|
1730
1733
|
*
|
|
1731
|
-
* @
|
|
1732
|
-
*
|
|
1733
|
-
* Default values:
|
|
1734
|
-
*
|
|
1735
|
-
* - `'[hash].module.wasm'`
|
|
1734
|
+
* @defaultValue `'[contenthash:8].module.wasm'`
|
|
1736
1735
|
*/
|
|
1737
1736
|
wasm?: Rspack.WebassemblyModuleFilename;
|
|
1738
1737
|
/**
|
|
1739
1738
|
* The name of other assets, except for above (image, svg, font, html, wasm...)
|
|
1740
1739
|
*
|
|
1741
|
-
* @
|
|
1742
|
-
*
|
|
1743
|
-
* Default values:
|
|
1744
|
-
*
|
|
1745
|
-
* - `'[name].[contenthash:8][ext]'`
|
|
1740
|
+
* @defaultValue `'[name].[contenthash:8][ext]'`
|
|
1746
1741
|
*/
|
|
1747
1742
|
assets?: Rspack.AssetModuleFilename;
|
|
1748
1743
|
}
|
|
@@ -1774,7 +1769,17 @@ export declare function loadConfig(loadConfigOptions: LoadConfigOptions): Promis
|
|
|
1774
1769
|
* @public
|
|
1775
1770
|
*/
|
|
1776
1771
|
export declare interface LoadConfigOptions {
|
|
1772
|
+
/**
|
|
1773
|
+
* The config file path to load.
|
|
1774
|
+
*
|
|
1775
|
+
* @defaultValue Automatically resolves `lynx.config.ts`, `lynx.config.js`, `lynx.config.mts`, or `lynx.config.mjs` from `cwd`
|
|
1776
|
+
*/
|
|
1777
1777
|
configPath?: string | undefined;
|
|
1778
|
+
/**
|
|
1779
|
+
* The working directory used to resolve the config path.
|
|
1780
|
+
*
|
|
1781
|
+
* @defaultValue `process.cwd()`
|
|
1782
|
+
*/
|
|
1778
1783
|
cwd?: string | undefined;
|
|
1779
1784
|
}
|
|
1780
1785
|
|
|
@@ -1830,7 +1835,7 @@ export { logger }
|
|
|
1830
1835
|
*
|
|
1831
1836
|
* @remarks
|
|
1832
1837
|
*
|
|
1833
|
-
* This is actually an alias of {@link https://rsbuild.
|
|
1838
|
+
* This is actually an alias of {@link https://rsbuild.rs/api/javascript-api/core#mergersbuildconfig | mergeRsbuildConfig}.
|
|
1834
1839
|
*
|
|
1835
1840
|
* @public
|
|
1836
1841
|
*/
|
|
@@ -1845,6 +1850,8 @@ export declare interface Minify {
|
|
|
1845
1850
|
/**
|
|
1846
1851
|
* Whether enable the CSS minification.
|
|
1847
1852
|
*
|
|
1853
|
+
* @defaultValue When `output.minify` is enabled and `css` is unset, this defaults to `true`.
|
|
1854
|
+
*
|
|
1848
1855
|
* @remarks
|
|
1849
1856
|
*
|
|
1850
1857
|
* When building for production, {@link https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer | @rsbuild/plugin-css-minimizer} is used to minify CSS assets for better transmission efficiency.
|
|
@@ -1869,6 +1876,8 @@ export declare interface Minify {
|
|
|
1869
1876
|
/**
|
|
1870
1877
|
* Whether enable the JavaScript minification.
|
|
1871
1878
|
*
|
|
1879
|
+
* @defaultValue When `output.minify` is enabled and `js` is unset, this defaults to `true`.
|
|
1880
|
+
*
|
|
1872
1881
|
* @example
|
|
1873
1882
|
*
|
|
1874
1883
|
* - Disable the JavaScript minification.
|
|
@@ -1889,9 +1898,11 @@ export declare interface Minify {
|
|
|
1889
1898
|
/**
|
|
1890
1899
|
* {@link Minify.jsOptions} is used to configure SWC minification options.
|
|
1891
1900
|
*
|
|
1901
|
+
* @defaultValue When JavaScript minification is enabled and `jsOptions` is unset, this defaults to `{}`.
|
|
1902
|
+
*
|
|
1892
1903
|
* @remarks
|
|
1893
1904
|
*
|
|
1894
|
-
* For detailed configurations, please refer to {@link https://rspack.
|
|
1905
|
+
* For detailed configurations, please refer to {@link https://rspack.rs/plugins/rspack/swc-js-minimizer-rspack-plugin | SwcJsMinimizerRspackPlugin}.
|
|
1895
1906
|
*
|
|
1896
1907
|
* @example
|
|
1897
1908
|
*
|
|
@@ -1918,6 +1929,8 @@ export declare interface Minify {
|
|
|
1918
1929
|
* {@link Minify.mainThreadOptions} is used to override
|
|
1919
1930
|
* {@link Minify.jsOptions} for main-thread bundles.
|
|
1920
1931
|
*
|
|
1932
|
+
* @defaultValue undefined
|
|
1933
|
+
*
|
|
1921
1934
|
* @remarks
|
|
1922
1935
|
*
|
|
1923
1936
|
* This option is deep-merged into {@link Minify.jsOptions}.
|
|
@@ -1956,6 +1969,8 @@ export declare interface Minify {
|
|
|
1956
1969
|
* {@link Minify.backgroundOptions} is used to override
|
|
1957
1970
|
* {@link Minify.jsOptions} for background-thread bundles.
|
|
1958
1971
|
*
|
|
1972
|
+
* @defaultValue undefined
|
|
1973
|
+
*
|
|
1959
1974
|
* @remarks
|
|
1960
1975
|
*
|
|
1961
1976
|
* This option is deep-merged into {@link Minify.jsOptions}.
|
|
@@ -1973,9 +1988,11 @@ export declare interface Output {
|
|
|
1973
1988
|
/**
|
|
1974
1989
|
* The {@link Output.assetPrefix} is used to set the URL prefix for static assets.
|
|
1975
1990
|
*
|
|
1991
|
+
* @defaultValue undefined
|
|
1992
|
+
*
|
|
1976
1993
|
* @remarks
|
|
1977
1994
|
*
|
|
1978
|
-
* The functionality of {@link Output.assetPrefix} is basically the same as the {@link https://
|
|
1995
|
+
* The functionality of {@link Output.assetPrefix} is basically the same as the {@link https://rspack.rs/config/output#outputpublicpath | output.publicPath}
|
|
1979
1996
|
* config in Rspack. With the following differences:
|
|
1980
1997
|
*
|
|
1981
1998
|
* - `output.assetPrefix` only takes effect in the production build.
|
|
@@ -2003,7 +2020,9 @@ export declare interface Output {
|
|
|
2003
2020
|
*
|
|
2004
2021
|
* By default, if the output directory is a subdirectory of the project root path, Rspeedy will automatically clean all files in the build directory.
|
|
2005
2022
|
*
|
|
2006
|
-
* When {@link https://rsbuild.
|
|
2023
|
+
* When {@link https://rsbuild.rs/config/output/dist-path#root-directory | output.distPath.root} is an external directory or the same as the project root directory, `cleanDistPath` is not enabled by default to prevent accidental deletion of files from other directories.
|
|
2024
|
+
*
|
|
2025
|
+
* @defaultValue Automatically enabled when `output.distPath.root` is a subdirectory of the project root; otherwise disabled.
|
|
2007
2026
|
*
|
|
2008
2027
|
* @example
|
|
2009
2028
|
*
|
|
@@ -2034,9 +2053,11 @@ export declare interface Output {
|
|
|
2034
2053
|
/**
|
|
2035
2054
|
* The {@link Output.copy} option is used for copying files to the dist directory.
|
|
2036
2055
|
*
|
|
2056
|
+
* @defaultValue undefined
|
|
2057
|
+
*
|
|
2037
2058
|
* @remarks
|
|
2038
2059
|
*
|
|
2039
|
-
* For more options, see {@link https://rspack.
|
|
2060
|
+
* For more options, see {@link https://rspack.rs/plugins/rspack/copy-rspack-plugin | Rspack.CopyRspackPlugin}.
|
|
2040
2061
|
*
|
|
2041
2062
|
* @example
|
|
2042
2063
|
*
|
|
@@ -2076,6 +2097,8 @@ export declare interface Output {
|
|
|
2076
2097
|
/**
|
|
2077
2098
|
* The {@link CssModules} option is used for the customization of CSS Modules configurations.
|
|
2078
2099
|
*
|
|
2100
|
+
* @defaultValue undefined
|
|
2101
|
+
*
|
|
2079
2102
|
* @remarks
|
|
2080
2103
|
*
|
|
2081
2104
|
* The CSS module is enabled for `*.module.css`, `*.module.scss` and `*.module.less`.
|
|
@@ -2115,9 +2138,7 @@ export declare interface Output {
|
|
|
2115
2138
|
/**
|
|
2116
2139
|
* The {@link Output.dataUriLimit} option is used to set the size threshold to inline static assets such as images and fonts.
|
|
2117
2140
|
*
|
|
2118
|
-
* @
|
|
2119
|
-
*
|
|
2120
|
-
* The default value of `dataUriLimit` is 2kB.
|
|
2141
|
+
* @defaultValue 2048
|
|
2121
2142
|
*
|
|
2122
2143
|
* @example
|
|
2123
2144
|
*
|
|
@@ -2178,9 +2199,11 @@ export declare interface Output {
|
|
|
2178
2199
|
/**
|
|
2179
2200
|
* Set the directory of the dist files.
|
|
2180
2201
|
*
|
|
2202
|
+
* @defaultValue Uses Rsbuild's default distPath configuration with `root: 'dist'`.
|
|
2203
|
+
*
|
|
2181
2204
|
* @remarks
|
|
2182
2205
|
*
|
|
2183
|
-
* More options can be found at {@link https://rsbuild.
|
|
2206
|
+
* More options can be found at {@link https://rsbuild.rs/config/output/dist-path | Rsbuild - distPath}.
|
|
2184
2207
|
*
|
|
2185
2208
|
* @example
|
|
2186
2209
|
*
|
|
@@ -2201,6 +2224,8 @@ export declare interface Output {
|
|
|
2201
2224
|
/**
|
|
2202
2225
|
* The {@link Filename} determines the name of the JavaScript bundle file to be output. These bundles will be written to the directory specified by output.path.
|
|
2203
2226
|
*
|
|
2227
|
+
* @defaultValue `{ bundle: '[name].[platform].bundle', template: '[name].[platform].bundle' }`
|
|
2228
|
+
*
|
|
2204
2229
|
* @remarks
|
|
2205
2230
|
*
|
|
2206
2231
|
* If a string is provided, it will be used as {@link Filename.bundle}.
|
|
@@ -2220,6 +2245,8 @@ export declare interface Output {
|
|
|
2220
2245
|
/**
|
|
2221
2246
|
* The {@link Output.filenameHash} option controls whether to add a hash value to the filename after the production build.
|
|
2222
2247
|
*
|
|
2248
|
+
* @defaultValue In production web builds, Rsbuild defaults this option to `true`; development builds and non-web outputs omit hashes by default.
|
|
2249
|
+
*
|
|
2223
2250
|
* @remarks
|
|
2224
2251
|
*
|
|
2225
2252
|
* {@link Output.filename} has a higher priority than {@link Output.filenameHash}.
|
|
@@ -2264,11 +2291,11 @@ export declare interface Output {
|
|
|
2264
2291
|
/**
|
|
2265
2292
|
* The {@link Output.inlineScripts} option controls whether to inline scripts into Lynx bundle (`.lynx.bundle`).
|
|
2266
2293
|
*
|
|
2267
|
-
* @
|
|
2294
|
+
* @defaultValue Rspeedy defaults this to `true` and only switches it to `false` when the user explicitly sets `performance.chunkSplit.strategy` to a value other than `'all-in-one'`.
|
|
2268
2295
|
*
|
|
2269
|
-
*
|
|
2296
|
+
* @remarks
|
|
2270
2297
|
*
|
|
2271
|
-
* This is different with {@link https://rsbuild.
|
|
2298
|
+
* This is different with {@link https://rsbuild.rs/config/output/inline-scripts | output.inlineScripts } since we normally want to inline scripts in Lynx bundle (`.lynx.bundle`).
|
|
2272
2299
|
*
|
|
2273
2300
|
* There are two points that need to be especially noted:
|
|
2274
2301
|
*
|
|
@@ -2293,9 +2320,9 @@ export declare interface Output {
|
|
|
2293
2320
|
/**
|
|
2294
2321
|
* The {@link Output.legalComments} controls how to handle the legal comment.
|
|
2295
2322
|
*
|
|
2296
|
-
* @
|
|
2323
|
+
* @defaultValue `'none'`
|
|
2297
2324
|
*
|
|
2298
|
-
*
|
|
2325
|
+
* @remarks
|
|
2299
2326
|
*
|
|
2300
2327
|
* This is different with Rsbuild since we normally do not want a `.LEGAL.txt` file in Lynx outputs.
|
|
2301
2328
|
*
|
|
@@ -2311,6 +2338,8 @@ export declare interface Output {
|
|
|
2311
2338
|
/**
|
|
2312
2339
|
* The {@link Minify} configures whether to enable code minification in the production build, or to configure minimizer options.
|
|
2313
2340
|
*
|
|
2341
|
+
* @defaultValue `true` in production builds and `false` otherwise
|
|
2342
|
+
*
|
|
2314
2343
|
* @example
|
|
2315
2344
|
*
|
|
2316
2345
|
* Disable minification.
|
|
@@ -2326,6 +2355,8 @@ export declare interface Output {
|
|
|
2326
2355
|
minify?: Minify | boolean | undefined;
|
|
2327
2356
|
/**
|
|
2328
2357
|
* The {@link SourceMap} configures whether and how to generate source-map for outputs.
|
|
2358
|
+
*
|
|
2359
|
+
* @defaultValue When this option is unset, JavaScript source maps use `'cheap-module-source-map'` in development and are otherwise disabled; CSS source maps are disabled.
|
|
2329
2360
|
*/
|
|
2330
2361
|
sourceMap?: boolean | SourceMap | undefined;
|
|
2331
2362
|
}
|
|
@@ -2339,6 +2370,8 @@ export declare interface Performance {
|
|
|
2339
2370
|
/**
|
|
2340
2371
|
* Enable or configure persistent build cache.
|
|
2341
2372
|
*
|
|
2373
|
+
* @defaultValue false
|
|
2374
|
+
*
|
|
2342
2375
|
* @beta This feature is experimental and may be changed in the future.
|
|
2343
2376
|
*
|
|
2344
2377
|
* @example
|
|
@@ -2375,14 +2408,14 @@ export declare interface Performance {
|
|
|
2375
2408
|
buildCache?: BuildCache | boolean | undefined;
|
|
2376
2409
|
/**
|
|
2377
2410
|
* {@link Performance.chunkSplit} is used to configure the chunk splitting strategy.
|
|
2411
|
+
*
|
|
2412
|
+
* @defaultValue For web builds, Rsbuild currently uses `{ strategy: 'split-by-experience' }` when this option is unset.
|
|
2378
2413
|
*/
|
|
2379
2414
|
chunkSplit?: ChunkSplit | ChunkSplitBySize | ChunkSplitCustom | undefined;
|
|
2380
2415
|
/**
|
|
2381
|
-
* Whether capture timing information in the build time and the runtime, the same as the {@link https://rspack.
|
|
2416
|
+
* Whether capture timing information in the build time and the runtime, the same as the {@link https://rspack.rs/config/other-options#profile | profile} config of Rspack.
|
|
2382
2417
|
*
|
|
2383
|
-
* @
|
|
2384
|
-
*
|
|
2385
|
-
* This option would be `true` when `DEBUG` environment variable contains `rspeedy`.
|
|
2418
|
+
* @defaultValue Rspeedy sets this to `true` when `DEBUG` contains `rspeedy`; otherwise it leaves the option unset.
|
|
2386
2419
|
*
|
|
2387
2420
|
* @example
|
|
2388
2421
|
*
|
|
@@ -2406,6 +2439,8 @@ export declare interface Performance {
|
|
|
2406
2439
|
/**
|
|
2407
2440
|
* Whether to remove `console.[methodName]` in production build.
|
|
2408
2441
|
*
|
|
2442
|
+
* @defaultValue false
|
|
2443
|
+
*
|
|
2409
2444
|
* @example
|
|
2410
2445
|
*
|
|
2411
2446
|
* - Remove all `console` methods
|
|
@@ -2438,9 +2473,11 @@ export declare interface Performance {
|
|
|
2438
2473
|
/**
|
|
2439
2474
|
* Whether to print the file sizes after production build.
|
|
2440
2475
|
*
|
|
2476
|
+
* @defaultValue true
|
|
2477
|
+
*
|
|
2441
2478
|
* {@link Performance.printFileSize}
|
|
2442
2479
|
*
|
|
2443
|
-
* See {@link https://rsbuild.
|
|
2480
|
+
* See {@link https://rsbuild.rs/config/performance/print-file-size | Rsbuild - performance.printFileSize} for details.
|
|
2444
2481
|
*
|
|
2445
2482
|
* @example
|
|
2446
2483
|
*
|
|
@@ -2560,6 +2597,8 @@ export declare interface Resolve {
|
|
|
2560
2597
|
/**
|
|
2561
2598
|
* Create aliases to `import` or `require` certain modules more easily.
|
|
2562
2599
|
*
|
|
2600
|
+
* @defaultValue undefined
|
|
2601
|
+
*
|
|
2563
2602
|
* @example
|
|
2564
2603
|
*
|
|
2565
2604
|
* A trailing `$` can also be added to the given object's keys to signify an exact match:
|
|
@@ -2640,6 +2679,9 @@ export declare interface Resolve {
|
|
|
2640
2679
|
/**
|
|
2641
2680
|
* Set the strategy for path alias resolution, to control the priority relationship
|
|
2642
2681
|
* between the `paths` option in `tsconfig.json` and the `resolve.alias` option of Rsbuild.
|
|
2682
|
+
*
|
|
2683
|
+
* @defaultValue `'prefer-tsconfig'`
|
|
2684
|
+
*
|
|
2643
2685
|
* - `prefer-tsconfig` (default): The `paths` option in `tsconfig.json` will take precedence over the
|
|
2644
2686
|
* `resolve.alias` option of Rsbuild.
|
|
2645
2687
|
* - `prefer-alias`: The `resolve.alias` option of Rsbuild will take precedence over the
|
|
@@ -2664,6 +2706,8 @@ export declare interface Resolve {
|
|
|
2664
2706
|
/**
|
|
2665
2707
|
* Force to resolve the specified packages from project root, which is useful for deduplicating packages and reducing the bundle size.
|
|
2666
2708
|
*
|
|
2709
|
+
* @defaultValue undefined
|
|
2710
|
+
*
|
|
2667
2711
|
* @remarks
|
|
2668
2712
|
*
|
|
2669
2713
|
* {@link Resolve.dedupe} is implemented based on {@link Resolve.alias}, it will get the path of the specified package through `require.resolve` in the project root directory and set it to the alias.
|
|
@@ -2688,7 +2732,7 @@ export declare interface Resolve {
|
|
|
2688
2732
|
/**
|
|
2689
2733
|
* Automatically resolve file extensions when importing modules. This means you can import files without explicitly writing their extensions.
|
|
2690
2734
|
*
|
|
2691
|
-
*
|
|
2735
|
+
* @defaultValue `['.ts', '.tsx', '.mjs', '.js', '.jsx', '.json', '.cjs']`
|
|
2692
2736
|
*
|
|
2693
2737
|
* For example, if importing './index', Rsbuild will try to resolve using the following order:
|
|
2694
2738
|
*
|
|
@@ -2756,12 +2800,14 @@ export declare interface Server {
|
|
|
2756
2800
|
/**
|
|
2757
2801
|
* Configure the base path of the server.
|
|
2758
2802
|
*
|
|
2803
|
+
* @defaultValue `'/'`
|
|
2804
|
+
*
|
|
2759
2805
|
* @remarks
|
|
2760
|
-
*
|
|
2806
|
+
* Users can access lynx bundle through `http://<host>:<port>/main.lynx.bundle` by default.
|
|
2761
2807
|
*
|
|
2762
2808
|
* If you want to access lynx bundle through `http://<host>:<port>/foo/main.lynx.bundle`, you can change `server.base` to `/foo`
|
|
2763
2809
|
*
|
|
2764
|
-
* you can refer to {@link https://rsbuild.
|
|
2810
|
+
* you can refer to {@link https://rsbuild.rs/config/server/base | server.base } for more information.
|
|
2765
2811
|
*
|
|
2766
2812
|
* @example
|
|
2767
2813
|
*
|
|
@@ -2778,7 +2824,7 @@ export declare interface Server {
|
|
|
2778
2824
|
/**
|
|
2779
2825
|
* 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.
|
|
2780
2826
|
*
|
|
2781
|
-
*
|
|
2827
|
+
* @defaultValue true
|
|
2782
2828
|
*
|
|
2783
2829
|
* See {@link https://rsbuild.rs/config/server/compress | Rsbuild - server.compress } for details.
|
|
2784
2830
|
*
|
|
@@ -2831,6 +2877,8 @@ export declare interface Server {
|
|
|
2831
2877
|
/**
|
|
2832
2878
|
* Configure CORS for the dev server or preview server.
|
|
2833
2879
|
*
|
|
2880
|
+
* @defaultValue Uses Rsbuild's default CORS options.
|
|
2881
|
+
*
|
|
2834
2882
|
* - Set to an object to enable CORS with the specified options.
|
|
2835
2883
|
*
|
|
2836
2884
|
* - Set to `true` to enable CORS with the default options (allows all origins, not recommended).
|
|
@@ -2855,6 +2903,8 @@ export declare interface Server {
|
|
|
2855
2903
|
/**
|
|
2856
2904
|
* Adds headers to all responses.
|
|
2857
2905
|
*
|
|
2906
|
+
* @defaultValue undefined
|
|
2907
|
+
*
|
|
2858
2908
|
* @example
|
|
2859
2909
|
*
|
|
2860
2910
|
* ```js
|
|
@@ -2872,8 +2922,10 @@ export declare interface Server {
|
|
|
2872
2922
|
/**
|
|
2873
2923
|
* Specify the host that the Rspeedy Server listens to.
|
|
2874
2924
|
*
|
|
2925
|
+
* @defaultValue undefined
|
|
2926
|
+
*
|
|
2875
2927
|
* @remarks
|
|
2876
|
-
*
|
|
2928
|
+
* During `rspeedy dev`, if `server.host` is unset, the dev plugin resolves dev-server-related URLs and client host settings with a detected local IPv4 address, such as `192.168.1.50`. If you have multiple network interfaces, set `server.host` explicitly to choose the desired address.
|
|
2877
2929
|
*
|
|
2878
2930
|
* @example
|
|
2879
2931
|
*
|
|
@@ -2892,8 +2944,10 @@ export declare interface Server {
|
|
|
2892
2944
|
/**
|
|
2893
2945
|
* Specify the port that the Rspeedy Server listens to.
|
|
2894
2946
|
*
|
|
2947
|
+
* @defaultValue Rsbuild defaults this option to `3000`.
|
|
2948
|
+
*
|
|
2895
2949
|
* @remarks
|
|
2896
|
-
* By default, the server
|
|
2950
|
+
* By default, the server automatically increments the port number when the configured port is occupied.
|
|
2897
2951
|
*
|
|
2898
2952
|
* @example
|
|
2899
2953
|
*
|
|
@@ -2912,6 +2966,8 @@ export declare interface Server {
|
|
|
2912
2966
|
/**
|
|
2913
2967
|
* Configure proxy rules for the dev server or preview server to proxy requests to the specified service.
|
|
2914
2968
|
*
|
|
2969
|
+
* @defaultValue undefined
|
|
2970
|
+
*
|
|
2915
2971
|
* @example
|
|
2916
2972
|
*
|
|
2917
2973
|
* ```js
|
|
@@ -2930,7 +2986,9 @@ export declare interface Server {
|
|
|
2930
2986
|
/**
|
|
2931
2987
|
* When a port is occupied, Rspeedy will automatically increment the port number until an available port is found.
|
|
2932
2988
|
*
|
|
2933
|
-
*
|
|
2989
|
+
* @defaultValue false
|
|
2990
|
+
*
|
|
2991
|
+
* By default, strict port mode is disabled. Set strictPort to true and Rspeedy will throw an exception when the port is occupied.
|
|
2934
2992
|
*/
|
|
2935
2993
|
strictPort?: boolean | undefined;
|
|
2936
2994
|
}
|
|
@@ -2945,10 +3003,14 @@ export declare interface Source {
|
|
|
2945
3003
|
* {@inheritdoc Resolve.alias}
|
|
2946
3004
|
*
|
|
2947
3005
|
* @deprecated - Use {@link Resolve.alias} instead.
|
|
3006
|
+
*
|
|
3007
|
+
* @defaultValue undefined
|
|
2948
3008
|
*/
|
|
2949
3009
|
alias?: Record<string, string | false | string[]> | undefined;
|
|
2950
3010
|
/**
|
|
2951
|
-
* Include additional files that should be treated as static assets.
|
|
3011
|
+
* Include additional files that should be treated as static assets.
|
|
3012
|
+
*
|
|
3013
|
+
* @defaultValue undefined
|
|
2952
3014
|
*
|
|
2953
3015
|
* @remarks
|
|
2954
3016
|
*
|
|
@@ -2956,7 +3018,7 @@ export declare interface Source {
|
|
|
2956
3018
|
* Through the source.assetsInclude config, you can specify additional file types that should be treated as static assets.
|
|
2957
3019
|
* These added static assets are processed using the same rules as the built-in supported static assets。
|
|
2958
3020
|
*
|
|
2959
|
-
* The usage of `source.assetsInclude` is consistent with {@link https://rspack.
|
|
3021
|
+
* The usage of `source.assetsInclude` is consistent with {@link https://rspack.rs/config/module#condition | Condition}
|
|
2960
3022
|
* in Rspack, which supports passing in strings, regular expressions, arrays of conditions, or logical conditions
|
|
2961
3023
|
* to match the module path or assets.
|
|
2962
3024
|
*
|
|
@@ -2975,6 +3037,8 @@ export declare interface Source {
|
|
|
2975
3037
|
/**
|
|
2976
3038
|
* Used to configure the decorators syntax.
|
|
2977
3039
|
*
|
|
3040
|
+
* @defaultValue undefined
|
|
3041
|
+
*
|
|
2978
3042
|
* @remarks
|
|
2979
3043
|
*
|
|
2980
3044
|
* See {@link Decorators.version} for more information.
|
|
@@ -2983,6 +3047,8 @@ export declare interface Source {
|
|
|
2983
3047
|
/**
|
|
2984
3048
|
* The `define` options is used to define some values or expressions at compile time.
|
|
2985
3049
|
*
|
|
3050
|
+
* @defaultValue undefined
|
|
3051
|
+
*
|
|
2986
3052
|
* @example
|
|
2987
3053
|
*
|
|
2988
3054
|
* Using `define` for environment variables.
|
|
@@ -3075,10 +3141,6 @@ export declare interface Source {
|
|
|
3075
3141
|
/**
|
|
3076
3142
|
* The {@link Entry} option is used to set the entry module.
|
|
3077
3143
|
*
|
|
3078
|
-
* @remarks
|
|
3079
|
-
*
|
|
3080
|
-
* If no value is provided, the default value `'./src/index.js'` will be used.
|
|
3081
|
-
*
|
|
3082
3144
|
* @defaultValue `'./src/index.js'`
|
|
3083
3145
|
*
|
|
3084
3146
|
* @example
|
|
@@ -3145,12 +3207,14 @@ export declare interface Source {
|
|
|
3145
3207
|
/**
|
|
3146
3208
|
* The `source.exclude` is used to specify JavaScript files that should be excluded from compilation.
|
|
3147
3209
|
*
|
|
3210
|
+
* @defaultValue undefined
|
|
3211
|
+
*
|
|
3148
3212
|
* @remarks
|
|
3149
3213
|
*
|
|
3150
3214
|
* By default, Rsbuild compiles JavaScript files in the current directory and TypeScript/JSX files
|
|
3151
3215
|
* in all directories. Through the `source.exclude` config, you can specify files or directories
|
|
3152
3216
|
* that should be excluded from compilation.
|
|
3153
|
-
* The usage of `source.exclude` is consistent with {@link https://rspack.
|
|
3217
|
+
* The usage of `source.exclude` is consistent with {@link https://rspack.rs/config/module#ruleexclude | Rule.exclude}
|
|
3154
3218
|
* in Rspack, which supports passing in strings or regular expressions to match module paths.
|
|
3155
3219
|
*
|
|
3156
3220
|
* @example
|
|
@@ -3206,6 +3270,8 @@ export declare interface Source {
|
|
|
3206
3270
|
/**
|
|
3207
3271
|
* The `source.include` is used to specify additional JavaScript files that need to be compiled.
|
|
3208
3272
|
*
|
|
3273
|
+
* @defaultValue When unset, Rsbuild compiles JavaScript files in the current directory and TypeScript or JSX files in all directories, while excluding JavaScript files under `node_modules`.
|
|
3274
|
+
*
|
|
3209
3275
|
* @remarks
|
|
3210
3276
|
*
|
|
3211
3277
|
* To avoid redundant compilation, by default, Rsbuild only compiles JavaScript
|
|
@@ -3214,7 +3280,7 @@ export declare interface Source {
|
|
|
3214
3280
|
*
|
|
3215
3281
|
* Through the `source.include` config, you can specify directories or modules
|
|
3216
3282
|
* that need to be compiled by Rsbuild.
|
|
3217
|
-
* The usage of `source.include` is consistent with {@link https://rspack.
|
|
3283
|
+
* The usage of `source.include` is consistent with {@link https://rspack.rs/config/module#ruleinclude | Rule.include}
|
|
3218
3284
|
* in Rspack, which supports passing in strings or regular expressions to match the module path.
|
|
3219
3285
|
*
|
|
3220
3286
|
* @example
|
|
@@ -3282,9 +3348,11 @@ export declare interface Source {
|
|
|
3282
3348
|
* Add a script before the entry file of each page. This script will be executed before the page code.
|
|
3283
3349
|
* It can be used to execute global logics, such as injecting polyfills, setting global styles, etc.
|
|
3284
3350
|
*
|
|
3351
|
+
* @defaultValue undefined
|
|
3352
|
+
*
|
|
3285
3353
|
* @remarks
|
|
3286
3354
|
*
|
|
3287
|
-
* See {@link https://rsbuild.
|
|
3355
|
+
* See {@link https://rsbuild.rs/config/source/pre-entry | source.preEntry} for more details.
|
|
3288
3356
|
*
|
|
3289
3357
|
* @example
|
|
3290
3358
|
*
|
|
@@ -3303,6 +3371,8 @@ export declare interface Source {
|
|
|
3303
3371
|
/**
|
|
3304
3372
|
* The {@link TransformImport} option transforms the import paths to enable modular imports from subpaths of third-party packages, similar to the functionality provided by {@link https://npmjs.com/package/babel-plugin-import | babel-plugin-import}.
|
|
3305
3373
|
*
|
|
3374
|
+
* @defaultValue undefined
|
|
3375
|
+
*
|
|
3306
3376
|
* @example
|
|
3307
3377
|
*
|
|
3308
3378
|
* When using the TUX component library, you can import components on demand with the following config:
|
|
@@ -3336,7 +3406,9 @@ export declare interface Source {
|
|
|
3336
3406
|
*/
|
|
3337
3407
|
transformImport?: TransformImport[] | undefined;
|
|
3338
3408
|
/**
|
|
3339
|
-
* Configure a custom `tsconfig.json` file path to use, can be a relative or absolute path.
|
|
3409
|
+
* Configure a custom `tsconfig.json` file path to use, can be a relative or absolute path.
|
|
3410
|
+
*
|
|
3411
|
+
* @defaultValue `'./tsconfig.json'`
|
|
3340
3412
|
*
|
|
3341
3413
|
* @remarks
|
|
3342
3414
|
*
|
|
@@ -3371,11 +3443,11 @@ export declare interface SourceMap {
|
|
|
3371
3443
|
/**
|
|
3372
3444
|
* How the source map should be generated. Setting it to `false` will disable the source map.
|
|
3373
3445
|
*
|
|
3374
|
-
* @
|
|
3446
|
+
* @defaultValue When `output.sourceMap` is an object and `js` is unset, it defaults to `'cheap-module-source-map'` in development and `false` in production.
|
|
3375
3447
|
*
|
|
3376
|
-
*
|
|
3448
|
+
* @remarks
|
|
3377
3449
|
*
|
|
3378
|
-
* See {@link https://rspack.
|
|
3450
|
+
* See {@link https://rspack.rs/config/devtool | Rspack - Devtool} for details.
|
|
3379
3451
|
*
|
|
3380
3452
|
* @example
|
|
3381
3453
|
*
|
|
@@ -3437,7 +3509,9 @@ export declare interface SourceMap {
|
|
|
3437
3509
|
*/
|
|
3438
3510
|
export declare interface Tools {
|
|
3439
3511
|
/**
|
|
3440
|
-
* The {@link Tools.bundlerChain} changes the options of {@link https://
|
|
3512
|
+
* The {@link Tools.bundlerChain} changes the options of {@link https://rspack.rs | Rspack} using {@link https://github.com/rspack-contrib/rspack-chain | rspack-chain}.
|
|
3513
|
+
*
|
|
3514
|
+
* @defaultValue undefined
|
|
3441
3515
|
*
|
|
3442
3516
|
* @example
|
|
3443
3517
|
*
|
|
@@ -3459,6 +3533,8 @@ export declare interface Tools {
|
|
|
3459
3533
|
/**
|
|
3460
3534
|
* The {@link CssLoader} controls the options of {@link https://github.com/webpack-contrib/css-loader | css-loader}.
|
|
3461
3535
|
*
|
|
3536
|
+
* @defaultValue Uses defaults derived from `output.cssModules` and `output.sourceMap`, with `importLoaders` set to `1` for CSS files and `2` for Sass/Less files.
|
|
3537
|
+
*
|
|
3462
3538
|
* @remarks
|
|
3463
3539
|
*
|
|
3464
3540
|
* The default option is as follow:
|
|
@@ -3479,12 +3555,19 @@ export declare interface Tools {
|
|
|
3479
3555
|
*/
|
|
3480
3556
|
cssLoader?: CssLoader | undefined;
|
|
3481
3557
|
/**
|
|
3482
|
-
* The {@link CssExtract} controls the options of {@link https://
|
|
3558
|
+
* The {@link CssExtract} controls the options of {@link https://rspack.rs/plugins/rspack/css-extract-rspack-plugin | CssExtractRspackPlugin}
|
|
3559
|
+
*
|
|
3560
|
+
* @defaultValue undefined
|
|
3483
3561
|
*/
|
|
3484
3562
|
cssExtract?: CssExtract | undefined;
|
|
3485
3563
|
/**
|
|
3486
3564
|
* The {@link Tools.rsdoctor} controls the options of {@link https://rsdoctor.dev/ | Rsdoctor}.
|
|
3487
3565
|
*
|
|
3566
|
+
* @defaultValue undefined
|
|
3567
|
+
*
|
|
3568
|
+
* @remarks
|
|
3569
|
+
* Setting `RSDOCTOR=true` enables Rsdoctor. When it is enabled, Rspeedy merges additional plugin defaults during config normalization.
|
|
3570
|
+
*
|
|
3488
3571
|
* @example
|
|
3489
3572
|
*
|
|
3490
3573
|
* - Use the built-in Rsdoctor.
|
|
@@ -3505,7 +3588,9 @@ export declare interface Tools {
|
|
|
3505
3588
|
*/
|
|
3506
3589
|
rsdoctor?: RsdoctorRspackPluginOptions | undefined;
|
|
3507
3590
|
/**
|
|
3508
|
-
* The {@link Tools.rspack} controls the options of {@link https://
|
|
3591
|
+
* The {@link Tools.rspack} controls the options of {@link https://rspack.rs/ | Rspack}.
|
|
3592
|
+
*
|
|
3593
|
+
* @defaultValue undefined
|
|
3509
3594
|
*
|
|
3510
3595
|
* @example
|
|
3511
3596
|
*
|
|
@@ -3525,7 +3610,7 @@ export declare interface Tools {
|
|
|
3525
3610
|
* })
|
|
3526
3611
|
* ```
|
|
3527
3612
|
*
|
|
3528
|
-
* See {@link https://
|
|
3613
|
+
* See {@link https://rspack.rs/config/index | Rspack - Configuration} for details.
|
|
3529
3614
|
*
|
|
3530
3615
|
* @example
|
|
3531
3616
|
*
|
|
@@ -3546,7 +3631,7 @@ export declare interface Tools {
|
|
|
3546
3631
|
* })
|
|
3547
3632
|
* ```
|
|
3548
3633
|
*
|
|
3549
|
-
* See {@link https://rsbuild.
|
|
3634
|
+
* See {@link https://rsbuild.rs/config/tools/rspack#env | Rsbuild - tools.rspack} for details.
|
|
3550
3635
|
*
|
|
3551
3636
|
* @example
|
|
3552
3637
|
*
|
|
@@ -3568,7 +3653,7 @@ export declare interface Tools {
|
|
|
3568
3653
|
* })
|
|
3569
3654
|
* ```
|
|
3570
3655
|
*
|
|
3571
|
-
* See {@link https://rsbuild.
|
|
3656
|
+
* See {@link https://rsbuild.rs/config/tools/rspack#mergeconfig | Rsbuild - tools.rspack} for details.
|
|
3572
3657
|
*
|
|
3573
3658
|
* @example
|
|
3574
3659
|
*
|
|
@@ -3587,11 +3672,13 @@ export declare interface Tools {
|
|
|
3587
3672
|
* })
|
|
3588
3673
|
* ```
|
|
3589
3674
|
*
|
|
3590
|
-
* See {@link https://rsbuild.
|
|
3675
|
+
* See {@link https://rsbuild.rs/config/tools/rspack#appendplugins | Rsbuild - tools.rspack} for details.
|
|
3591
3676
|
*/
|
|
3592
3677
|
rspack?: ToolsConfig['rspack'] | undefined;
|
|
3593
3678
|
/**
|
|
3594
|
-
* The {@link Tools.swc} controls the options of {@link https://rspack.
|
|
3679
|
+
* The {@link Tools.swc} controls the options of {@link https://rspack.rs/guide/features/builtin-swc-loader | builtin:swc-loader}.
|
|
3680
|
+
*
|
|
3681
|
+
* @defaultValue undefined
|
|
3595
3682
|
*/
|
|
3596
3683
|
swc?: ToolsConfig['swc'] | undefined;
|
|
3597
3684
|
}
|
|
@@ -3605,6 +3692,8 @@ export declare interface TransformImport {
|
|
|
3605
3692
|
/**
|
|
3606
3693
|
* Whether to convert camelCase imports to kebab-case.
|
|
3607
3694
|
*
|
|
3695
|
+
* @defaultValue Rsbuild defaults this option to `true`.
|
|
3696
|
+
*
|
|
3608
3697
|
* @example
|
|
3609
3698
|
*
|
|
3610
3699
|
* - Input:
|
|
@@ -3620,7 +3709,7 @@ export declare interface TransformImport {
|
|
|
3620
3709
|
* import ButtonGroup from 'foo/button-group'
|
|
3621
3710
|
* ```
|
|
3622
3711
|
*
|
|
3623
|
-
* When set to `false
|
|
3712
|
+
* When set to `false`:
|
|
3624
3713
|
* ```js
|
|
3625
3714
|
* import ButtonGroup from 'foo/ButtonGroup'
|
|
3626
3715
|
* ```
|
|
@@ -3629,6 +3718,8 @@ export declare interface TransformImport {
|
|
|
3629
3718
|
/**
|
|
3630
3719
|
* Customize the transformed path.
|
|
3631
3720
|
*
|
|
3721
|
+
* @defaultValue undefined
|
|
3722
|
+
*
|
|
3632
3723
|
* @remarks
|
|
3633
3724
|
*
|
|
3634
3725
|
* You you can specify the format of the transformed path.
|
|
@@ -3658,9 +3749,7 @@ export declare interface TransformImport {
|
|
|
3658
3749
|
/**
|
|
3659
3750
|
* Used to splice the transformed path, the splicing rule is `${libraryName}/${libraryDirectory}/${member}`, where member is the imported member.
|
|
3660
3751
|
*
|
|
3661
|
-
* @
|
|
3662
|
-
*
|
|
3663
|
-
* The default value is `'lib'`.
|
|
3752
|
+
* @defaultValue `'lib'`
|
|
3664
3753
|
*
|
|
3665
3754
|
* @example
|
|
3666
3755
|
*
|
|
@@ -3680,6 +3769,8 @@ export declare interface TransformImport {
|
|
|
3680
3769
|
/**
|
|
3681
3770
|
* Whether to convert import statements to default imports.
|
|
3682
3771
|
*
|
|
3772
|
+
* @defaultValue Rsbuild defaults this option to `true`.
|
|
3773
|
+
*
|
|
3683
3774
|
* @example
|
|
3684
3775
|
*
|
|
3685
3776
|
* - Input:
|
|
@@ -3695,7 +3786,7 @@ export declare interface TransformImport {
|
|
|
3695
3786
|
* import Button from 'foo/button'
|
|
3696
3787
|
* ```
|
|
3697
3788
|
*
|
|
3698
|
-
* When set to `false
|
|
3789
|
+
* When set to `false`:
|
|
3699
3790
|
* ```js
|
|
3700
3791
|
* import { Button } from 'foo/button'
|
|
3701
3792
|
* ```
|
package/dist/src_cli_main_ts.js
CHANGED
|
@@ -192,7 +192,7 @@ async function exit_onExit(signal) {
|
|
|
192
192
|
await Promise.allSettled(exitPromises);
|
|
193
193
|
}
|
|
194
194
|
var package_namespaceObject = {
|
|
195
|
-
rE: "0.14.
|
|
195
|
+
rE: "0.14.2"
|
|
196
196
|
};
|
|
197
197
|
const version_version = package_namespaceObject.rE;
|
|
198
198
|
const rspackVersion = rspack.rspackVersion;
|
package/dist/src_index_ts.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/rspeedy",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.2",
|
|
4
4
|
"description": "A webpack/rspack-based frontend toolchain for Lynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webpack",
|
|
@@ -48,17 +48,17 @@
|
|
|
48
48
|
"README.md"
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@rsbuild/core": "1.7.
|
|
51
|
+
"@rsbuild/core": "1.7.5",
|
|
52
52
|
"@rsbuild/plugin-css-minimizer": "1.1.1",
|
|
53
53
|
"@rsdoctor/rspack-plugin": "1.2.3",
|
|
54
54
|
"@lynx-js/cache-events-webpack-plugin": "^0.0.3",
|
|
55
55
|
"@lynx-js/chunk-loading-webpack-plugin": "^0.3.3",
|
|
56
|
-
"@lynx-js/web-rsbuild-server-middleware": "0.20.
|
|
56
|
+
"@lynx-js/web-rsbuild-server-middleware": "0.20.2",
|
|
57
57
|
"@lynx-js/webpack-dev-transport": "^0.2.0",
|
|
58
58
|
"@lynx-js/websocket": "^0.0.4"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@microsoft/api-extractor": "7.
|
|
61
|
+
"@microsoft/api-extractor": "7.58.2",
|
|
62
62
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
63
63
|
"chokidar": "^4.0.3",
|
|
64
64
|
"commander": "^13.1.0",
|