From 62fcc0f05a2a315c75dac76f7bebc9118511303e Mon Sep 17 00:00:00 2001 From: Qingyu Wang <40660121+colinaaa@users.noreply.github.com> Date: Sat, 11 Apr 2026 14:48:40 +0800 Subject: [PATCH] docs(api/rspeedy): update lynx-stack Change-Id: Ibc71cb4981a90d352bf51182f9c0f2c17964ebd5 --- ...in.externalsloadingplugin._constructor_.md | 34 +- ...ack-plugin.externalsloadingplugin.apply.md | 34 +- ...g-webpack-plugin.externalsloadingplugin.md | 66 +- ...ernalsloadingpluginoptions.globalobject.md | 19 + ...ck-plugin.externalsloadingpluginoptions.md | 128 +++- ...n.externalsloadingpluginoptions.timeout.md | 18 + ...ding-webpack-plugin.externalvalue.async.md | 5 + ...webpack-plugin.externalvalue.background.md | 5 + ...webpack-plugin.externalvalue.bundlepath.md | 15 + ...ebpack-plugin.externalvalue.libraryname.md | 4 + ...webpack-plugin.externalvalue.mainthread.md | 5 + ...ls-loading-webpack-plugin.externalvalue.md | 189 +++++- ...ng-webpack-plugin.externalvalue.timeout.md | 5 + ...oading-webpack-plugin.externalvalue.url.md | 6 +- ...als-loading-webpack-plugin.layeroptions.md | 44 +- .../externals-loading-webpack-plugin.md | 76 ++- ...onfig.builtinexternalspresetdefinitions.md | 2 +- ...b-config.defaultexternalbundlelibconfig.md | 2 +- ...-config.defineexternalbundlerslibconfig.md | 122 +++- ...slib-config.encodeoptions.engineversion.md | 18 + .../lynx-bundle-rslib-config.encodeoptions.md | 49 +- ...le-rslib-config.externalbundlelibconfig.md | 50 +- ...b-config.externalbundlelibconfig.output.md | 11 + ...ternalbundlewebpackplugin._constructor_.md | 34 +- ...onfig.externalbundlewebpackplugin.apply.md | 34 +- ...slib-config.externalbundlewebpackplugin.md | 71 ++- ...undlewebpackpluginoptions.engineversion.md | 18 + ...nfig.externalbundlewebpackpluginoptions.md | 89 ++- .../lynx-bundle-rslib-config.externals.md | 2 +- ...onfig.externalspresetdefinition.extends.md | 13 + ...fig.externalspresetdefinition.externals.md | 13 + ...-rslib-config.externalspresetdefinition.md | 67 +- ...rslib-config.externalspresetdefinitions.md | 4 +- ...nx-bundle-rslib-config.externalspresets.md | 6 +- ...ntimewrapperwebpackplugin._constructor_.md | 36 +- ...threadruntimewrapperwebpackplugin.apply.md | 34 +- ...g.mainthreadruntimewrapperwebpackplugin.md | 71 ++- ...hreadruntimewrapperwebpackpluginoptions.md | 49 +- ...runtimewrapperwebpackpluginoptions.test.md | 5 + .../api/rspeedy/lynx-bundle-rslib-config.md | 257 +++++++- .../lynx-bundle-rslib-config.outputconfig.md | 19 +- ...e-rslib-config.reactlynxexternalspreset.md | 2 +- docs/en/api/rspeedy/qrcode-rsbuild-plugin.md | 78 ++- .../qrcode-rsbuild-plugin.pluginqrcode.md | 36 +- ...code-rsbuild-plugin.pluginqrcodeoptions.md | 44 +- ...sbuild-plugin.addcomponentelementconfig.md | 44 +- ...eact-rsbuild-plugin.compatvisitorconfig.md | 204 +++++- ...t-rsbuild-plugin.definedcevisitorconfig.md | 44 +- .../react-rsbuild-plugin.extractstrconfig.md | 44 +- ...mplateplugin.getlynxtemplatepluginhooks.md | 11 + ...react-rsbuild-plugin.lynxtemplateplugin.md | 54 ++ docs/en/api/rspeedy/react-rsbuild-plugin.md | 121 +++- .../react-rsbuild-plugin.pluginreactlynx.md | 36 +- ...pluginreactlynxoptions.enablenewgesture.md | 5 + ...inreactlynxoptions.enableremovecssscope.md | 5 + ...plugin.pluginreactlynxoptions.enablessr.md | 5 + ...lugin.pluginreactlynxoptions.extractstr.md | 5 + ...nreactlynxoptions.firstscreensynctiming.md | 5 + ....pluginreactlynxoptions.globalpropsmode.md | 24 + ...t-rsbuild-plugin.pluginreactlynxoptions.md | 467 +++++++++++++- ...uginreactlynxoptions.optimizebundlesize.md | 23 + ...react-rsbuild-plugin.shakevisitorconfig.md | 103 ++- ...ld-plugin.shakevisitorconfig.removecall.md | 36 ++ ...gin.shakevisitorconfig.removecallparams.md | 2 +- .../rspeedy/rspeedy.buildcache.cachedigest.md | 4 + .../rspeedy.buildcache.cachedirectory.md | 5 + docs/en/api/rspeedy/rspeedy.buildcache.md | 84 ++- docs/en/api/rspeedy/rspeedy.chunksplit.md | 64 +- .../api/rspeedy/rspeedy.chunksplitbysize.md | 104 ++- .../api/rspeedy/rspeedy.chunksplitcustom.md | 64 +- docs/en/api/rspeedy/rspeedy.config.md | 224 ++++++- docs/en/api/rspeedy/rspeedy.configparams.md | 64 +- docs/en/api/rspeedy/rspeedy.createrspeedy.md | 50 +- ...rspeedy.createrspeedyoptions.callername.md | 4 + ...speedy.createrspeedyoptions.environment.md | 5 + .../rspeedy.createrspeedyoptions.loadenv.md | 5 + .../rspeedy/rspeedy.createrspeedyoptions.md | 124 +++- docs/en/api/rspeedy/rspeedy.cssextract.md | 65 +- .../rspeedy.cssextractrspackloaderoptions.md | 44 +- .../rspeedy.cssextractrspackpluginoptions.md | 65 +- docs/en/api/rspeedy/rspeedy.cssloader.md | 64 +- .../api/rspeedy/rspeedy.cssloadermodules.md | 104 ++- docs/en/api/rspeedy/rspeedy.cssmodules.md | 104 ++- docs/en/api/rspeedy/rspeedy.decorators.md | 44 +- docs/en/api/rspeedy/rspeedy.defineconfig.md | 36 +- docs/en/api/rspeedy/rspeedy.defineconfig_1.md | 36 +- docs/en/api/rspeedy/rspeedy.defineconfig_2.md | 36 +- docs/en/api/rspeedy/rspeedy.defineconfig_3.md | 36 +- docs/en/api/rspeedy/rspeedy.dev.md | 172 ++++- docs/en/api/rspeedy/rspeedy.devclient.md | 44 +- docs/en/api/rspeedy/rspeedy.distpath.md | 44 +- .../rspeedy.entrydescription.import.md | 4 + .../api/rspeedy/rspeedy.entrydescription.md | 64 +- docs/en/api/rspeedy/rspeedy.exposedapi.md | 124 +++- docs/en/api/rspeedy/rspeedy.filename.md | 224 ++++++- docs/en/api/rspeedy/rspeedy.loadconfig.md | 36 +- .../api/rspeedy/rspeedy.loadconfigoptions.md | 64 +- .../api/rspeedy/rspeedy.loadconfigresult.md | 64 +- docs/en/api/rspeedy/rspeedy.md | 593 ++++++++++++++++-- .../api/rspeedy/rspeedy.mergerspeedyconfig.md | 36 +- .../rspeedy.minify.backgroundoptions.md | 18 + .../rspeedy.minify.mainthreadoptions.md | 46 ++ docs/en/api/rspeedy/rspeedy.minify.md | 122 +++- docs/en/api/rspeedy/rspeedy.output.md | 264 +++++++- docs/en/api/rspeedy/rspeedy.performance.md | 130 +++- docs/en/api/rspeedy/rspeedy.resolve.md | 122 +++- docs/en/api/rspeedy/rspeedy.server.md | 198 +++++- docs/en/api/rspeedy/rspeedy.source.entry.md | 4 + docs/en/api/rspeedy/rspeedy.source.md | 224 ++++++- docs/en/api/rspeedy/rspeedy.sourcemap.md | 44 +- docs/en/api/rspeedy/rspeedy.tools.md | 144 ++++- .../en/api/rspeedy/rspeedy.transformimport.md | 124 +++- ...in.externalsloadingplugin._constructor_.md | 34 +- ...ack-plugin.externalsloadingplugin.apply.md | 34 +- ...g-webpack-plugin.externalsloadingplugin.md | 66 +- ...ernalsloadingpluginoptions.globalobject.md | 19 + ...ck-plugin.externalsloadingpluginoptions.md | 128 +++- ...n.externalsloadingpluginoptions.timeout.md | 18 + ...ding-webpack-plugin.externalvalue.async.md | 5 + ...webpack-plugin.externalvalue.background.md | 5 + ...webpack-plugin.externalvalue.bundlepath.md | 15 + ...ebpack-plugin.externalvalue.libraryname.md | 4 + ...webpack-plugin.externalvalue.mainthread.md | 5 + ...ls-loading-webpack-plugin.externalvalue.md | 189 +++++- ...ng-webpack-plugin.externalvalue.timeout.md | 5 + ...oading-webpack-plugin.externalvalue.url.md | 6 +- ...als-loading-webpack-plugin.layeroptions.md | 44 +- .../externals-loading-webpack-plugin.md | 76 ++- ...onfig.builtinexternalspresetdefinitions.md | 2 +- ...b-config.defaultexternalbundlelibconfig.md | 2 +- ...-config.defineexternalbundlerslibconfig.md | 122 +++- ...slib-config.encodeoptions.engineversion.md | 18 + .../lynx-bundle-rslib-config.encodeoptions.md | 49 +- ...le-rslib-config.externalbundlelibconfig.md | 50 +- ...b-config.externalbundlelibconfig.output.md | 11 + ...ternalbundlewebpackplugin._constructor_.md | 34 +- ...onfig.externalbundlewebpackplugin.apply.md | 34 +- ...slib-config.externalbundlewebpackplugin.md | 71 ++- ...undlewebpackpluginoptions.engineversion.md | 18 + ...nfig.externalbundlewebpackpluginoptions.md | 89 ++- .../lynx-bundle-rslib-config.externals.md | 2 +- ...onfig.externalspresetdefinition.extends.md | 13 + ...fig.externalspresetdefinition.externals.md | 13 + ...-rslib-config.externalspresetdefinition.md | 67 +- ...rslib-config.externalspresetdefinitions.md | 4 +- ...nx-bundle-rslib-config.externalspresets.md | 6 +- ...ntimewrapperwebpackplugin._constructor_.md | 36 +- ...threadruntimewrapperwebpackplugin.apply.md | 34 +- ...g.mainthreadruntimewrapperwebpackplugin.md | 71 ++- ...hreadruntimewrapperwebpackpluginoptions.md | 49 +- ...runtimewrapperwebpackpluginoptions.test.md | 5 + .../api/rspeedy/lynx-bundle-rslib-config.md | 257 +++++++- .../lynx-bundle-rslib-config.outputconfig.md | 19 +- ...e-rslib-config.reactlynxexternalspreset.md | 2 +- docs/zh/api/rspeedy/qrcode-rsbuild-plugin.md | 78 ++- .../qrcode-rsbuild-plugin.pluginqrcode.md | 36 +- ...code-rsbuild-plugin.pluginqrcodeoptions.md | 44 +- .../rspeedy/rspeedy.buildcache.cachedigest.md | 4 + .../rspeedy.buildcache.cachedirectory.md | 5 + docs/zh/api/rspeedy/rspeedy.buildcache.md | 84 ++- docs/zh/api/rspeedy/rspeedy.chunksplit.md | 64 +- .../api/rspeedy/rspeedy.chunksplitbysize.md | 104 ++- .../api/rspeedy/rspeedy.chunksplitcustom.md | 64 +- docs/zh/api/rspeedy/rspeedy.config.md | 224 ++++++- docs/zh/api/rspeedy/rspeedy.configparams.md | 64 +- docs/zh/api/rspeedy/rspeedy.createrspeedy.md | 50 +- ...rspeedy.createrspeedyoptions.callername.md | 4 + ...speedy.createrspeedyoptions.environment.md | 5 + .../rspeedy.createrspeedyoptions.loadenv.md | 5 + .../rspeedy/rspeedy.createrspeedyoptions.md | 124 +++- docs/zh/api/rspeedy/rspeedy.cssextract.md | 65 +- .../rspeedy.cssextractrspackloaderoptions.md | 44 +- .../rspeedy.cssextractrspackpluginoptions.md | 65 +- docs/zh/api/rspeedy/rspeedy.cssloader.md | 64 +- .../api/rspeedy/rspeedy.cssloadermodules.md | 104 ++- docs/zh/api/rspeedy/rspeedy.cssmodules.md | 104 ++- docs/zh/api/rspeedy/rspeedy.decorators.md | 44 +- docs/zh/api/rspeedy/rspeedy.defineconfig.md | 36 +- docs/zh/api/rspeedy/rspeedy.defineconfig_1.md | 36 +- docs/zh/api/rspeedy/rspeedy.defineconfig_2.md | 36 +- docs/zh/api/rspeedy/rspeedy.defineconfig_3.md | 36 +- docs/zh/api/rspeedy/rspeedy.dev.md | 172 ++++- docs/zh/api/rspeedy/rspeedy.devclient.md | 44 +- docs/zh/api/rspeedy/rspeedy.distpath.md | 44 +- .../rspeedy.entrydescription.import.md | 4 + .../api/rspeedy/rspeedy.entrydescription.md | 64 +- docs/zh/api/rspeedy/rspeedy.exposedapi.md | 124 +++- docs/zh/api/rspeedy/rspeedy.filename.md | 224 ++++++- docs/zh/api/rspeedy/rspeedy.loadconfig.md | 36 +- .../api/rspeedy/rspeedy.loadconfigoptions.md | 64 +- .../api/rspeedy/rspeedy.loadconfigresult.md | 64 +- docs/zh/api/rspeedy/rspeedy.md | 593 ++++++++++++++++-- .../api/rspeedy/rspeedy.mergerspeedyconfig.md | 36 +- .../rspeedy.minify.backgroundoptions.md | 18 + .../rspeedy.minify.mainthreadoptions.md | 46 ++ docs/zh/api/rspeedy/rspeedy.minify.md | 122 +++- docs/zh/api/rspeedy/rspeedy.output.md | 264 +++++++- docs/zh/api/rspeedy/rspeedy.performance.md | 130 +++- docs/zh/api/rspeedy/rspeedy.resolve.md | 122 +++- docs/zh/api/rspeedy/rspeedy.server.md | 198 +++++- docs/zh/api/rspeedy/rspeedy.source.entry.md | 4 + docs/zh/api/rspeedy/rspeedy.source.md | 224 ++++++- docs/zh/api/rspeedy/rspeedy.sourcemap.md | 44 +- docs/zh/api/rspeedy/rspeedy.tools.md | 144 ++++- .../zh/api/rspeedy/rspeedy.transformimport.md | 124 +++- packages/lynx-compat-data/api-stats.json | 2 +- 206 files changed, 12745 insertions(+), 961 deletions(-) create mode 100644 docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.globalobject.md create mode 100644 docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.timeout.md create mode 100644 docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.bundlepath.md create mode 100644 docs/en/api/rspeedy/lynx-bundle-rslib-config.encodeoptions.engineversion.md create mode 100644 docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlelibconfig.output.md create mode 100644 docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.engineversion.md create mode 100644 docs/en/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.extends.md create mode 100644 docs/en/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.externals.md create mode 100644 docs/en/api/rspeedy/react-rsbuild-plugin.lynxtemplateplugin.getlynxtemplatepluginhooks.md create mode 100644 docs/en/api/rspeedy/react-rsbuild-plugin.lynxtemplateplugin.md create mode 100644 docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.globalpropsmode.md create mode 100644 docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.optimizebundlesize.md create mode 100644 docs/en/api/rspeedy/react-rsbuild-plugin.shakevisitorconfig.removecall.md create mode 100644 docs/en/api/rspeedy/rspeedy.minify.backgroundoptions.md create mode 100644 docs/en/api/rspeedy/rspeedy.minify.mainthreadoptions.md create mode 100644 docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.globalobject.md create mode 100644 docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.timeout.md create mode 100644 docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.bundlepath.md create mode 100644 docs/zh/api/rspeedy/lynx-bundle-rslib-config.encodeoptions.engineversion.md create mode 100644 docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlelibconfig.output.md create mode 100644 docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.engineversion.md create mode 100644 docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.extends.md create mode 100644 docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.externals.md create mode 100644 docs/zh/api/rspeedy/rspeedy.minify.backgroundoptions.md create mode 100644 docs/zh/api/rspeedy/rspeedy.minify.mainthreadoptions.md diff --git a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin._constructor_.md b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin._constructor_.md index 7415b5ea0..a71fed5bf 100644 --- a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin._constructor_.md +++ b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin._constructor_.md @@ -14,7 +14,35 @@ constructor(options: ExternalsLoadingPluginOptions); ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| options | [ExternalsLoadingPluginOptions](./externals-loading-webpack-plugin.externalsloadingpluginoptions.md) | | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +options + + + + +[ExternalsLoadingPluginOptions](./externals-loading-webpack-plugin.externalsloadingpluginoptions.md) + + + + + +
diff --git a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin.apply.md b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin.apply.md index fe8c11abc..f8f478a46 100644 --- a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin.apply.md +++ b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin.apply.md @@ -12,9 +12,37 @@ apply(compiler: Compiler): void; ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| compiler | Compiler | | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +compiler + + + + +Compiler + + + + + +
**Returns:** diff --git a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin.md b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin.md index bf53e1e7e..648d3459b 100644 --- a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin.md +++ b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin.md @@ -45,13 +45,67 @@ export default { ## Constructors -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(options)](./externals-loading-webpack-plugin.externalsloadingplugin._constructor_.md) | | Constructs a new instance of the ExternalsLoadingPlugin class | + + +
+ +Constructor + + + + +Modifiers + + + + +Description + + +
+ +[(constructor)(options)](./externals-loading-webpack-plugin.externalsloadingplugin._constructor_.md) + + + + + + + +Constructs a new instance of the `ExternalsLoadingPlugin` class + + +
## Methods -| Method | Modifiers | Description | -| --- | --- | --- | -| [apply(compiler)](./externals-loading-webpack-plugin.externalsloadingplugin.apply.md) | | | + + +
+ +Method + + + + +Modifiers + + + + +Description + + +
+ +[apply(compiler)](./externals-loading-webpack-plugin.externalsloadingplugin.apply.md) + + + + + + + + +
diff --git a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.globalobject.md b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.globalobject.md new file mode 100644 index 000000000..02b001e1a --- /dev/null +++ b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.globalobject.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [@lynx-js/externals-loading-webpack-plugin](./externals-loading-webpack-plugin.md) > [ExternalsLoadingPluginOptions](./externals-loading-webpack-plugin.externalsloadingpluginoptions.md) > [globalObject](./externals-loading-webpack-plugin.externalsloadingpluginoptions.globalobject.md) + +## ExternalsLoadingPluginOptions.globalObject property + +This option indicates what global object will be used to mount the library. + +In Lynx, the library will be mounted to `lynx[Symbol.for("__LYNX_EXTERNAL_GLOBAL__")]` by default. + +If you have enabled share js context and want to reuse the library by mounting to the global object, you can set this option to `'globalThis'`. + + 'lynx' + +**Signature:** + +```typescript +globalObject?: 'lynx' | 'globalThis' | undefined; +``` diff --git a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.md b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.md index a8382ffa5..21d42b005 100644 --- a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.md +++ b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.md @@ -14,9 +14,127 @@ export interface ExternalsLoadingPluginOptions ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [backgroundLayer](./externals-loading-webpack-plugin.externalsloadingpluginoptions.backgroundlayer.md) | | string | The name of the background layer. | -| [externals](./externals-loading-webpack-plugin.externalsloadingpluginoptions.externals.md) | | Record<string, [ExternalValue](./externals-loading-webpack-plugin.externalvalue.md)> | Specify the externals to be loaded. The externals should be Lynx Bundles. | -| [mainThreadLayer](./externals-loading-webpack-plugin.externalsloadingpluginoptions.mainthreadlayer.md) | | string | The name of the main thread layer. | + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[backgroundLayer](./externals-loading-webpack-plugin.externalsloadingpluginoptions.backgroundlayer.md) + + + + + + + +string + + + + +The name of the background layer. + + +
+ +[externals](./externals-loading-webpack-plugin.externalsloadingpluginoptions.externals.md) + + + + + + + +Record<string, [ExternalValue](./externals-loading-webpack-plugin.externalvalue.md)> + + + + +Specify the externals to be loaded. The externals should be Lynx Bundles. + + +
+ +[globalObject?](./externals-loading-webpack-plugin.externalsloadingpluginoptions.globalobject.md) + + + + + + + +'lynx' \| 'globalThis' \| undefined + + + + +_(Optional)_ This option indicates what global object will be used to mount the library. + +In Lynx, the library will be mounted to `lynx[Symbol.for("__LYNX_EXTERNAL_GLOBAL__")]` by default. + +If you have enabled share js context and want to reuse the library by mounting to the global object, you can set this option to `'globalThis'`. + + 'lynx' + + +
+ +[mainThreadLayer](./externals-loading-webpack-plugin.externalsloadingpluginoptions.mainthreadlayer.md) + + + + + + + +string + + + + +The name of the main thread layer. + + +
+ +[timeout?](./externals-loading-webpack-plugin.externalsloadingpluginoptions.timeout.md) + + + + + + + +number \| undefined + + + + +_(Optional)_ The timeout in milliseconds for loading the externals. + + +
diff --git a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.timeout.md b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.timeout.md new file mode 100644 index 000000000..f12bda3e4 --- /dev/null +++ b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.timeout.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [@lynx-js/externals-loading-webpack-plugin](./externals-loading-webpack-plugin.md) > [ExternalsLoadingPluginOptions](./externals-loading-webpack-plugin.externalsloadingpluginoptions.md) > [timeout](./externals-loading-webpack-plugin.externalsloadingpluginoptions.timeout.md) + +## ExternalsLoadingPluginOptions.timeout property + +The timeout in milliseconds for loading the externals. + +**Signature:** + +```typescript +timeout?: number | undefined; +``` + +## Default Value + +2000 + diff --git a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.async.md b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.async.md index e765534f5..ee68855c5 100644 --- a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.async.md +++ b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.async.md @@ -11,3 +11,8 @@ Whether the source should be loaded asynchronously or not. ```typescript async?: boolean; ``` + +## Default Value + +`true` + diff --git a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.background.md b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.background.md index fa3796edf..fcbdad882 100644 --- a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.background.md +++ b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.background.md @@ -11,3 +11,8 @@ The options of the background layer. ```typescript background?: LayerOptions; ``` + +## Default Value + +`undefined` + diff --git a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.bundlepath.md b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.bundlepath.md new file mode 100644 index 000000000..9dbc0adb1 --- /dev/null +++ b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.bundlepath.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [@lynx-js/externals-loading-webpack-plugin](./externals-loading-webpack-plugin.md) > [ExternalValue](./externals-loading-webpack-plugin.externalvalue.md) > [bundlePath](./externals-loading-webpack-plugin.externalvalue.bundlepath.md) + +## ExternalValue.bundlePath property + +The bundle path resolved against the runtime public path. + +Prefer this over `url` when the bundle should follow the active `publicPath`. The runtime will load it with `publicPath + bundlePath`, which keeps external bundle resolution aligned with the current build output without hard-coding an absolute URL into the generated runtime code. + +**Signature:** + +```typescript +bundlePath?: string; +``` diff --git a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.libraryname.md b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.libraryname.md index 1c6d3c64d..911171e19 100644 --- a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.libraryname.md +++ b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.libraryname.md @@ -76,6 +76,10 @@ externals: { libraryName?: string | string[]; ``` +## Default Value + +`undefined` + ## Example `Lodash` diff --git a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.mainthread.md b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.mainthread.md index b3d5686bc..354023d0b 100644 --- a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.mainthread.md +++ b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.mainthread.md @@ -11,3 +11,8 @@ The options of the main-thread layer. ```typescript mainThread?: LayerOptions; ``` + +## Default Value + +`undefined` + diff --git a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.md b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.md index 800959915..8977676a5 100644 --- a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.md +++ b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.md @@ -4,6 +4,7 @@ ## ExternalValue interface +The value item of the externals. **Signature:** @@ -13,11 +14,107 @@ export interface ExternalValue ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [async?](./externals-loading-webpack-plugin.externalvalue.async.md) | | boolean | _(Optional)_ Whether the source should be loaded asynchronously or not. | -| [background?](./externals-loading-webpack-plugin.externalvalue.background.md) | | [LayerOptions](./externals-loading-webpack-plugin.layeroptions.md) | _(Optional)_ The options of the background layer. | -| [libraryName?](./externals-loading-webpack-plugin.externalvalue.libraryname.md) | | string \| string\[\] |

_(Optional)_ The name of the library. Same as https://webpack.js.org/configuration/externals/\#string.

By default, the library name is the same as the externals key. For example:

The config

+ + + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[async?](./externals-loading-webpack-plugin.externalvalue.async.md) + + + + + + + +boolean + + + + +_(Optional)_ Whether the source should be loaded asynchronously or not. + + +
+ +[background?](./externals-loading-webpack-plugin.externalvalue.background.md) + + + + + + + +[LayerOptions](./externals-loading-webpack-plugin.layeroptions.md) + + + + +_(Optional)_ The options of the background layer. + + +
+ +[bundlePath?](./externals-loading-webpack-plugin.externalvalue.bundlepath.md) + + + + + + + +string + + + + +_(Optional)_ The bundle path resolved against the runtime public path. + +Prefer this over `url` when the bundle should follow the active `publicPath`. The runtime will load it with `publicPath + bundlePath`, which keeps external bundle resolution aligned with the current build output without hard-coding an absolute URL into the generated runtime code. + + +
+ +[libraryName?](./externals-loading-webpack-plugin.externalvalue.libraryname.md) + + + + + + + +string \| string\[\] + + + + +_(Optional)_ The name of the library. Same as https://webpack.js.org/configuration/externals/\#string. + +By default, the library name is the same as the externals key. For example: + +The config + ```js ExternalsLoadingPlugin({ externals: { @@ -27,13 +124,15 @@ ExternalsLoadingPlugin({ } }) ``` -

Will generate the following webpack externals config:

+Will generate the following webpack externals config: + ```js externals: { lodash: 'lynx[Symbol.for("__LYNX_EXTERNAL_GLOBAL__")].lodash', } ``` -

If one external bundle contains multiple modules, should set the same library name to ensure it's loaded only once. For example:

+If one external bundle contains multiple modules, should set the same library name to ensure it's loaded only once. For example: + ```js ExternalsLoadingPlugin({ externals: { @@ -48,14 +147,16 @@ ExternalsLoadingPlugin({ } }) ``` -

Will generate the following webpack externals config:

+Will generate the following webpack externals config: + ```js externals: { lodash: 'lynx[Symbol.for("__LYNX_EXTERNAL_GLOBAL__")].Lodash', 'lodash-es': 'lynx[Symbol.for("__LYNX_EXTERNAL_GLOBAL__")].Lodash', } ``` -

You can pass an array to specify subpath of the external. Same as https://webpack.js.org/configuration/externals/\#string-1. For example:

+You can pass an array to specify subpath of the external. Same as https://webpack.js.org/configuration/externals/\#string-1. For example: + ```js ExternalsLoadingPlugin({ externals: { @@ -66,14 +167,74 @@ ExternalsLoadingPlugin({ } }) ``` -

Will generate the following webpack externals config:

+Will generate the following webpack externals config: + ```js externals: { preact: 'lynx[Symbol.for("__LYNX_EXTERNAL_GLOBAL__")].ReactLynx.Preact', } ``` - | -| [mainThread?](./externals-loading-webpack-plugin.externalvalue.mainthread.md) | | [LayerOptions](./externals-loading-webpack-plugin.layeroptions.md) | _(Optional)_ The options of the main-thread layer. | -| [timeout?](./externals-loading-webpack-plugin.externalvalue.timeout.md) | | number | _(Optional)_ The wait time in milliseconds. | -| [url](./externals-loading-webpack-plugin.externalvalue.url.md) | | string | The bundle(lynx.bundle) url of the library. The library source should be placed in customSections. | + + +
+ +[mainThread?](./externals-loading-webpack-plugin.externalvalue.mainthread.md) + + + + + + + +[LayerOptions](./externals-loading-webpack-plugin.layeroptions.md) + + + + +_(Optional)_ The options of the main-thread layer. + + +
+ +[timeout?](./externals-loading-webpack-plugin.externalvalue.timeout.md) + + + + + + + +number + + + + +_(Optional)_ The wait time in milliseconds. + + +
+ +[url?](./externals-loading-webpack-plugin.externalvalue.url.md) + + + + + + + +string + + + + +_(Optional)_ The final bundle URL to fetch directly at runtime. + +Use this when the external bundle is hosted outside the current build output, such as on a CDN. If both `url` and `bundlePath` are provided, `url` takes precedence because it is already the fully resolved address. + + +
diff --git a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.timeout.md b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.timeout.md index b8b7f8eb1..180c7b2a0 100644 --- a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.timeout.md +++ b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.timeout.md @@ -11,3 +11,8 @@ The wait time in milliseconds. ```typescript timeout?: number; ``` + +## Default Value + +`2000` + diff --git a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.url.md b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.url.md index 433d0dc9c..6e9149fac 100644 --- a/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.url.md +++ b/docs/en/api/rspeedy/externals-loading-webpack-plugin.externalvalue.url.md @@ -4,10 +4,12 @@ ## ExternalValue.url property -The bundle(lynx.bundle) url of the library. The library source should be placed in `customSections`. +The final bundle URL to fetch directly at runtime. + +Use this when the external bundle is hosted outside the current build output, such as on a CDN. If both `url` and `bundlePath` are provided, `url` takes precedence because it is already the fully resolved address. **Signature:** ```typescript -url: string; +url?: string; ``` diff --git a/docs/en/api/rspeedy/externals-loading-webpack-plugin.layeroptions.md b/docs/en/api/rspeedy/externals-loading-webpack-plugin.layeroptions.md index cf66d5042..c7c662514 100644 --- a/docs/en/api/rspeedy/externals-loading-webpack-plugin.layeroptions.md +++ b/docs/en/api/rspeedy/externals-loading-webpack-plugin.layeroptions.md @@ -14,7 +14,45 @@ export interface LayerOptions ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [sectionPath](./externals-loading-webpack-plugin.layeroptions.sectionpath.md) | | string | The path in customSections. | + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[sectionPath](./externals-loading-webpack-plugin.layeroptions.sectionpath.md) + + + + + + + +string + + + + +The path in `customSections`. + + +
diff --git a/docs/en/api/rspeedy/externals-loading-webpack-plugin.md b/docs/en/api/rspeedy/externals-loading-webpack-plugin.md index d5698f240..7feab1634 100644 --- a/docs/en/api/rspeedy/externals-loading-webpack-plugin.md +++ b/docs/en/api/rspeedy/externals-loading-webpack-plugin.md @@ -12,15 +12,75 @@ Requires Lynx version 3.5 or later. ## Classes -| Class | Description | -| --- | --- | -| [ExternalsLoadingPlugin](./externals-loading-webpack-plugin.externalsloadingplugin.md) | The webpack plugin to load lynx external bundles. | + + +
+ +Class + + + + +Description + + +
+ +[ExternalsLoadingPlugin](./externals-loading-webpack-plugin.externalsloadingplugin.md) + + + + +The webpack plugin to load lynx external bundles. + + +
## Interfaces -| Interface | Description | -| --- | --- | -| [ExternalsLoadingPluginOptions](./externals-loading-webpack-plugin.externalsloadingpluginoptions.md) | The options of the ExternalsLoadingPlugin. | -| [ExternalValue](./externals-loading-webpack-plugin.externalvalue.md) | | -| [LayerOptions](./externals-loading-webpack-plugin.layeroptions.md) | The options of the background or main-thread layer. | + + + + +
+ +Interface + + + + +Description + + +
+ +[ExternalsLoadingPluginOptions](./externals-loading-webpack-plugin.externalsloadingpluginoptions.md) + + + + +The options of the `ExternalsLoadingPlugin`. + + +
+ +[ExternalValue](./externals-loading-webpack-plugin.externalvalue.md) + + + + +The value item of the externals. + + +
+ +[LayerOptions](./externals-loading-webpack-plugin.layeroptions.md) + + + + +The options of the background or main-thread layer. + + +
diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.builtinexternalspresetdefinitions.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.builtinexternalspresetdefinitions.md index 47c485a96..eb2d500e0 100644 --- a/docs/en/api/rspeedy/lynx-bundle-rslib-config.builtinexternalspresetdefinitions.md +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.builtinexternalspresetdefinitions.md @@ -9,5 +9,5 @@ Built-in externals preset definitions. **Signature:** ```typescript -export declare const builtInExternalsPresetDefinitions: ExternalsPresetDefinitions; +builtInExternalsPresetDefinitions: ExternalsPresetDefinitions ``` diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.defaultexternalbundlelibconfig.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.defaultexternalbundlelibconfig.md index 3b1bbfed7..5e0a90d99 100644 --- a/docs/en/api/rspeedy/lynx-bundle-rslib-config.defaultexternalbundlelibconfig.md +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.defaultexternalbundlelibconfig.md @@ -9,5 +9,5 @@ The default lib config for external bundle. **Signature:** ```typescript -export declare const defaultExternalBundleLibConfig: LibConfig; +DEFAULT_EXTERNAL_BUNDLE_LIB_CONFIG: LibConfig ``` diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.defineexternalbundlerslibconfig.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.defineexternalbundlerslibconfig.md index 925c63492..65c49467b 100644 --- a/docs/en/api/rspeedy/lynx-bundle-rslib-config.defineexternalbundlerslibconfig.md +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.defineexternalbundlerslibconfig.md @@ -4,7 +4,7 @@ ## defineExternalBundleRslibConfig() function -Get the Rslib config for building Lynx external bundles. +Get the rslib config for building Lynx external bundles. **Signature:** @@ -14,34 +14,118 @@ export declare function defineExternalBundleRslibConfig(userLibConfig: ExternalB ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| userLibConfig | [ExternalBundleLibConfig](./lynx-bundle-rslib-config.externalbundlelibconfig.md) | User-provided Rslib config. | -| encodeOptions | [EncodeOptions](./lynx-bundle-rslib-config.encodeoptions.md) | Optional encode options. | + + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +userLibConfig + + + + +[ExternalBundleLibConfig](./lynx-bundle-rslib-config.externalbundlelibconfig.md) + + + + + +
+ +encodeOptions + + + + +[EncodeOptions](./lynx-bundle-rslib-config.encodeoptions.md) + + + + +_(Optional)_ + + +
**Returns:** -`RslibConfig` +RslibConfig + +## Example 1 -## Example +If you want to build an external bundle which use in Lynx background thread, you can use the following code: -```ts +```js +// rslib.config.js import { defineExternalBundleRslibConfig } from '@lynx-js/lynx-bundle-rslib-config' -import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin' export default defineExternalBundleRslibConfig({ - id: 'comp-lib', + id: 'utils-lib', source: { entry: { - './App.js': './external-bundle/CompLib.tsx', - }, - }, - plugins: [pluginReactLynx()], - output: { - externalsPresets: { - reactlynx: true, + utils: { + import: './src/utils.ts', + layer: 'background', + } + } + } +}) +``` +Then you can use `lynx.loadScript('utils', { bundleName: 'utils-lib-bundle-url' })` in background thread. + +## Example 2 + +If you want to build an external bundle which use in Lynx main thread, you can use the following code: + +```js +// rslib.config.js +import { defineExternalBundleRslibConfig } from '@lynx-js/lynx-bundle-rslib-config' + +export default defineExternalBundleRslibConfig({ + id: 'utils-lib', + source: { + entry: { + utils: { + import: './src/utils.ts', + layer: 'main-thread', + } + } + } +}) +``` +Then you can use `lynx.loadScript('utils', { bundleName: 'utils-lib-bundle-url' })` in main-thread. + +## Example 3 + +If you want to build an external bundle which use both in Lynx main thread and background thread. You don't need to set the layer. + +```js +// rslib.config.js +import { defineExternalBundleRslibConfig } from '@lynx-js/lynx-bundle-rslib-config' + +export default defineExternalBundleRslibConfig({ + id: 'utils-lib', + source: { + entry: { + utils: './src/utils.ts', }, - globalObject: 'globalThis', - }, + } }) ``` +Then you can use `lynx.loadScript('utils', { bundleName: 'utils-lib-bundle-url' })` in background thread and `lynx.loadScript('utils__main-thread', { bundleName: 'utils-lib-bundle-url' })` in main-thread. + diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.encodeoptions.engineversion.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.encodeoptions.engineversion.md new file mode 100644 index 000000000..97f532489 --- /dev/null +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.encodeoptions.engineversion.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [@lynx-js/lynx-bundle-rslib-config](./lynx-bundle-rslib-config.md) > [EncodeOptions](./lynx-bundle-rslib-config.encodeoptions.md) > [engineVersion](./lynx-bundle-rslib-config.encodeoptions.engineversion.md) + +## EncodeOptions.engineVersion property + +The engine version of the external bundle. + +**Signature:** + +```typescript +engineVersion?: string; +``` + +## Default Value + +'3.5' + diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.encodeoptions.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.encodeoptions.md index e0fc59bdb..af321bccb 100644 --- a/docs/en/api/rspeedy/lynx-bundle-rslib-config.encodeoptions.md +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.encodeoptions.md @@ -4,16 +4,55 @@ ## EncodeOptions interface -Options for encoding the external bundle. +The options for encoding the external bundle. **Signature:** ```typescript -export interface EncodeOptions +export interface EncodeOptions ``` ## Properties -| Property | Type | Description | -| --- | --- | --- | -| `engineVersion?` | `string` | The engine version of the external bundle. | + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[engineVersion?](./lynx-bundle-rslib-config.encodeoptions.engineversion.md) + + + + + + + +string + + + + +_(Optional)_ The engine version of the external bundle. + + +
+ diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlelibconfig.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlelibconfig.md index 0ce8553a7..e2be1ab60 100644 --- a/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlelibconfig.md +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlelibconfig.md @@ -4,16 +4,56 @@ ## ExternalBundleLibConfig interface -Rslib config shape accepted by `defineExternalBundleRslibConfig`. +Rslib config shape accepted by `defineExternalBundleRslibConfig`. **Signature:** ```typescript -export interface ExternalBundleLibConfig extends LibConfig +export interface ExternalBundleLibConfig extends LibConfig ``` +**Extends:** LibConfig ## Properties -| Property | Type | Description | -| --- | --- | --- | -| `output?` | [`OutputConfig`](./lynx-bundle-rslib-config.outputconfig.md) | Output config accepted by Lynx external bundle builds. | + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[output?](./lynx-bundle-rslib-config.externalbundlelibconfig.output.md) + + + + + + + +[OutputConfig](./lynx-bundle-rslib-config.outputconfig.md) + + + + +_(Optional)_ + + +
+ diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlelibconfig.output.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlelibconfig.output.md new file mode 100644 index 000000000..58aa29a66 --- /dev/null +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlelibconfig.output.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [@lynx-js/lynx-bundle-rslib-config](./lynx-bundle-rslib-config.md) > [ExternalBundleLibConfig](./lynx-bundle-rslib-config.externalbundlelibconfig.md) > [output](./lynx-bundle-rslib-config.externalbundlelibconfig.output.md) + +## ExternalBundleLibConfig.output property + +**Signature:** + +```typescript +output?: OutputConfig; +``` diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin._constructor_.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin._constructor_.md index 41120def6..8eb477c3e 100644 --- a/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin._constructor_.md +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin._constructor_.md @@ -14,7 +14,35 @@ constructor(options: ExternalBundleWebpackPluginOptions); ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| options | [ExternalBundleWebpackPluginOptions](./lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.md) | | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +options + + + + +[ExternalBundleWebpackPluginOptions](./lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.md) + + + + + +
diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin.apply.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin.apply.md index d50f899e4..e144ffd91 100644 --- a/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin.apply.md +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin.apply.md @@ -12,9 +12,37 @@ apply(compiler: Compiler): void; ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| compiler | Compiler | | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +compiler + + + + +Compiler + + + + + +
**Returns:** diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin.md index db5e1181c..7218e79e5 100644 --- a/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin.md +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin.md @@ -4,22 +4,77 @@ ## ExternalBundleWebpackPlugin class -Webpack plugin that builds and emits an external bundle. +The webpack plugin to build and emit the external bundle. **Signature:** ```typescript -export declare class ExternalBundleWebpackPlugin +export declare class ExternalBundleWebpackPlugin ``` ## Constructors -| Constructor | Description | -| --- | --- | -| `new ExternalBundleWebpackPlugin(options)` | Constructs a new instance of `ExternalBundleWebpackPlugin`. | + + +
+ +Constructor + + + + +Modifiers + + + + +Description + + +
+ +[(constructor)(options)](./lynx-bundle-rslib-config.externalbundlewebpackplugin._constructor_.md) + + + + + + + +Constructs a new instance of the `ExternalBundleWebpackPlugin` class + + +
## Methods -| Method | Return Type | Description | -| --- | --- | --- | -| `apply(compiler)` | `void` | Apply the plugin to the compiler. | + + +
+ +Method + + + + +Modifiers + + + + +Description + + +
+ +[apply(compiler)](./lynx-bundle-rslib-config.externalbundlewebpackplugin.apply.md) + + + + + + + + +
+ diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.engineversion.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.engineversion.md new file mode 100644 index 000000000..c0e93b533 --- /dev/null +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.engineversion.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [@lynx-js/lynx-bundle-rslib-config](./lynx-bundle-rslib-config.md) > [ExternalBundleWebpackPluginOptions](./lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.md) > [engineVersion](./lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.engineversion.md) + +## ExternalBundleWebpackPluginOptions.engineVersion property + +The engine version of the external bundle. + +**Signature:** + +```typescript +engineVersion?: string | undefined; +``` + +## Default Value + +'3.5' + diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.md index 1e12160bf..2a257afe6 100644 --- a/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.md +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.md @@ -4,18 +4,93 @@ ## ExternalBundleWebpackPluginOptions interface -Options for `ExternalBundleWebpackPlugin`. +The options for [ExternalBundleWebpackPlugin](./lynx-bundle-rslib-config.externalbundlewebpackplugin.md). **Signature:** ```typescript -export interface ExternalBundleWebpackPluginOptions +export interface ExternalBundleWebpackPluginOptions ``` ## Properties -| Property | Type | Description | -| --- | --- | --- | -| `bundleFileName` | `string` | The external bundle filename. | -| `encode` | `(opts: unknown) => Promise<{ buffer: Buffer; }>` | Encode method exported from the Lynx encoder package. | -| `engineVersion?` | `string` | The target engine version of the external bundle. | + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[bundleFileName](./lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.bundlefilename.md) + + + + + + + +string + + + + +The external bundle filename. + + +
+ +[encode](./lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.encode.md) + + + + + + + +(opts: unknown) => Promise<{ buffer: Buffer; }> + + + + +The encode method which is exported from lynx-tasm package. + + +
+ +[engineVersion?](./lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.engineversion.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ The engine version of the external bundle. + + +
+ diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.externals.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externals.md index 6725c2dc3..0fd7d73b8 100644 --- a/docs/en/api/rspeedy/lynx-bundle-rslib-config.externals.md +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externals.md @@ -2,7 +2,7 @@ [Home](./index.md) > [@lynx-js/lynx-bundle-rslib-config](./lynx-bundle-rslib-config.md) > [Externals](./lynx-bundle-rslib-config.externals.md) -## Externals type alias +## Externals type External module to global-name mappings used when building Lynx external bundles. diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.extends.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.extends.md new file mode 100644 index 000000000..f9f5e2302 --- /dev/null +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.extends.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [@lynx-js/lynx-bundle-rslib-config](./lynx-bundle-rslib-config.md) > [ExternalsPresetDefinition](./lynx-bundle-rslib-config.externalspresetdefinition.md) > [extends](./lynx-bundle-rslib-config.externalspresetdefinition.extends.md) + +## ExternalsPresetDefinition.extends property + +Other preset names to include before applying the current preset. + +**Signature:** + +```typescript +extends?: string | string[]; +``` diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.externals.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.externals.md new file mode 100644 index 000000000..68939d05e --- /dev/null +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.externals.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [@lynx-js/lynx-bundle-rslib-config](./lynx-bundle-rslib-config.md) > [ExternalsPresetDefinition](./lynx-bundle-rslib-config.externalspresetdefinition.md) > [externals](./lynx-bundle-rslib-config.externalspresetdefinition.externals.md) + +## ExternalsPresetDefinition.externals property + +Externals contributed by this preset. + +**Signature:** + +```typescript +externals?: Externals; +``` diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.md index 16849726c..6be3e8c8f 100644 --- a/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.md +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.md @@ -9,12 +9,69 @@ Definition for a named externals preset. **Signature:** ```typescript -export interface ExternalsPresetDefinition +export interface ExternalsPresetDefinition ``` ## Properties -| Property | Type | Description | -| --- | --- | --- | -| `extends?` | `string \| string[]` | Other preset names to include before applying the current preset. | -| `externals?` | [`Externals`](./lynx-bundle-rslib-config.externals.md) | Externals contributed by this preset. | + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[extends?](./lynx-bundle-rslib-config.externalspresetdefinition.extends.md) + + + + + + + +string \| string\[\] + + + + +_(Optional)_ Other preset names to include before applying the current preset. + + +
+ +[externals?](./lynx-bundle-rslib-config.externalspresetdefinition.externals.md) + + + + + + + +[Externals](./lynx-bundle-rslib-config.externals.md) + + + + +_(Optional)_ Externals contributed by this preset. + + +
+ diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinitions.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinitions.md index d4e6876de..2f4778cce 100644 --- a/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinitions.md +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinitions.md @@ -2,7 +2,7 @@ [Home](./index.md) > [@lynx-js/lynx-bundle-rslib-config](./lynx-bundle-rslib-config.md) > [ExternalsPresetDefinitions](./lynx-bundle-rslib-config.externalspresetdefinitions.md) -## ExternalsPresetDefinitions type alias +## ExternalsPresetDefinitions type Available externals preset definitions. @@ -11,3 +11,5 @@ Available externals preset definitions. ```typescript export type ExternalsPresetDefinitions = Record; ``` +**References:** [ExternalsPresetDefinition](./lynx-bundle-rslib-config.externalspresetdefinition.md) + diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalspresets.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalspresets.md index 3a5ed3787..e3ea2c2c0 100644 --- a/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalspresets.md +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.externalspresets.md @@ -2,14 +2,16 @@ [Home](./index.md) > [@lynx-js/lynx-bundle-rslib-config](./lynx-bundle-rslib-config.md) > [ExternalsPresets](./lynx-bundle-rslib-config.externalspresets.md) -## ExternalsPresets type alias +## ExternalsPresets type Enabled externals presets. +Preset names are resolved from the built-in preset definitions plus any custom definitions passed to [defineExternalBundleRslibConfig()](./lynx-bundle-rslib-config.defineexternalbundlerslibconfig.md). + **Signature:** ```typescript export type ExternalsPresets = { - reactlynx?: boolean; + reactlynx?: boolean; } & Record; ``` diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin._constructor_.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin._constructor_.md index 0837b86ba..7912f3d7c 100644 --- a/docs/en/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin._constructor_.md +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin._constructor_.md @@ -14,7 +14,37 @@ constructor(options?: Partial); ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| options | Partial<[MainThreadRuntimeWrapperWebpackPluginOptions](./lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.md)> | _(Optional)_ | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +options + + + + +Partial<[MainThreadRuntimeWrapperWebpackPluginOptions](./lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.md)> + + + + +_(Optional)_ + + +
diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.apply.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.apply.md index 90a2c5a92..99ba71f0a 100644 --- a/docs/en/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.apply.md +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.apply.md @@ -12,9 +12,37 @@ apply(compiler: Compiler): void; ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| compiler | Compiler | | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +compiler + + + + +Compiler + + + + + +
**Returns:** diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.md index 5ec8ed50c..095450c06 100644 --- a/docs/en/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.md +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.md @@ -4,22 +4,77 @@ ## MainThreadRuntimeWrapperWebpackPlugin class -Webpack plugin that wraps main-thread runtime modules for external bundles. +The main-thread runtime wrapper for external bundle. **Signature:** ```typescript -export declare class MainThreadRuntimeWrapperWebpackPlugin +export declare class MainThreadRuntimeWrapperWebpackPlugin ``` ## Constructors -| Constructor | Description | -| --- | --- | -| `new MainThreadRuntimeWrapperWebpackPlugin(options?)` | Constructs a new instance of `MainThreadRuntimeWrapperWebpackPlugin`. | + + +
+ +Constructor + + + + +Modifiers + + + + +Description + + +
+ +[(constructor)(options)](./lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin._constructor_.md) + + + + + + + +Constructs a new instance of the `MainThreadRuntimeWrapperWebpackPlugin` class + + +
## Methods -| Method | Return Type | Description | -| --- | --- | --- | -| `apply(compiler)` | `void` | Apply the plugin to the compiler. | + + +
+ +Method + + + + +Modifiers + + + + +Description + + +
+ +[apply(compiler)](./lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.apply.md) + + + + + + + + +
+ diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.md index e0767cf82..3ad499b62 100644 --- a/docs/en/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.md +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.md @@ -4,16 +4,55 @@ ## MainThreadRuntimeWrapperWebpackPluginOptions interface -Options for `MainThreadRuntimeWrapperWebpackPlugin`. +The options of [MainThreadRuntimeWrapperWebpackPlugin](./lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.md). **Signature:** ```typescript -export interface MainThreadRuntimeWrapperWebpackPluginOptions +export interface MainThreadRuntimeWrapperWebpackPluginOptions ``` ## Properties -| Property | Type | Description | -| --- | --- | --- | -| `test` | `BannerPlugin['options']['test']` | Include all modules that pass the test assertion. | + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[test](./lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.test.md) + + + + + + + +BannerPlugin\['options'\]\['test'\] + + + + +Include all modules that pass test assertion. + + +
+ diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.test.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.test.md index 42a4bc2d7..4f04a37ca 100644 --- a/docs/en/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.test.md +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.test.md @@ -11,3 +11,8 @@ Include all modules that pass test assertion. ```typescript test: BannerPlugin['options']['test']; ``` + +## Default Value + +`/\.js$/` + diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.md index 1705c30ec..12b5aac77 100644 --- a/docs/en/api/rspeedy/lynx-bundle-rslib-config.md +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.md @@ -4,44 +4,247 @@ ## lynx-bundle-rslib-config package -`@lynx-js/lynx-bundle-rslib-config` is the package that provides the configurations for bundling Lynx bundle with [Rslib](https://rslib.rs/). +`@lynx-js/lynx-bundle-rslib-config` is the package that provides the configurations for bundling Lynx bundle with [Rslib](https://rslib.rs/). ## Classes -| Class | Description | -| --- | --- | -| [ExternalBundleWebpackPlugin](./lynx-bundle-rslib-config.externalbundlewebpackplugin.md) | Webpack plugin that builds and emits an external bundle. | -| [MainThreadRuntimeWrapperWebpackPlugin](./lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.md) | Webpack plugin that wraps main-thread runtime modules for external bundles. | + + + +
+ +Class + + + + +Description + + +
+ +[ExternalBundleWebpackPlugin](./lynx-bundle-rslib-config.externalbundlewebpackplugin.md) + + + + +The webpack plugin to build and emit the external bundle. + + +
+ +[MainThreadRuntimeWrapperWebpackPlugin](./lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.md) + + + + +The main-thread runtime wrapper for external bundle. + + +
## Functions -| Function | Description | -| --- | --- | -| [defineExternalBundleRslibConfig(userLibConfig, encodeOptions)](./lynx-bundle-rslib-config.defineexternalbundlerslibconfig.md) | Get the Rslib config for building Lynx external bundles. | + + +
+ +Function + + + + +Description + + +
+ +[defineExternalBundleRslibConfig(userLibConfig, encodeOptions)](./lynx-bundle-rslib-config.defineexternalbundlerslibconfig.md) + + + + +Get the rslib config for building Lynx external bundles. + + +
## Interfaces -| Interface | Description | -| --- | --- | -| [EncodeOptions](./lynx-bundle-rslib-config.encodeoptions.md) | Options for encoding the external bundle. | -| [ExternalBundleLibConfig](./lynx-bundle-rslib-config.externalbundlelibconfig.md) | Rslib config shape accepted by `defineExternalBundleRslibConfig`. | -| [ExternalBundleWebpackPluginOptions](./lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.md) | Options for `ExternalBundleWebpackPlugin`. | -| [ExternalsPresetDefinition](./lynx-bundle-rslib-config.externalspresetdefinition.md) | Definition for a named externals preset. | -| [MainThreadRuntimeWrapperWebpackPluginOptions](./lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.md) | Options for `MainThreadRuntimeWrapperWebpackPlugin`. | + + + + + + +
+ +Interface + + + + +Description + + +
+ +[EncodeOptions](./lynx-bundle-rslib-config.encodeoptions.md) + + + + +The options for encoding the external bundle. + + +
+ +[ExternalBundleLibConfig](./lynx-bundle-rslib-config.externalbundlelibconfig.md) + + + + +Rslib config shape accepted by `defineExternalBundleRslibConfig`. + + +
+ +[ExternalBundleWebpackPluginOptions](./lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.md) + + + + +The options for [ExternalBundleWebpackPlugin](./lynx-bundle-rslib-config.externalbundlewebpackplugin.md). + + +
+ +[ExternalsPresetDefinition](./lynx-bundle-rslib-config.externalspresetdefinition.md) + + + + +Definition for a named externals preset. + + +
+ +[MainThreadRuntimeWrapperWebpackPluginOptions](./lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.md) -## Type Aliases -| Type Alias | Description | -| --- | --- | -| [Externals](./lynx-bundle-rslib-config.externals.md) | External module to global-name mappings used when building Lynx external bundles. | -| [ExternalsPresetDefinitions](./lynx-bundle-rslib-config.externalspresetdefinitions.md) | Available externals preset definitions. | -| [ExternalsPresets](./lynx-bundle-rslib-config.externalspresets.md) | Enabled externals presets. | -| [OutputConfig](./lynx-bundle-rslib-config.outputconfig.md) | Output config accepted by Lynx external bundle builds. | + + +The options of [MainThreadRuntimeWrapperWebpackPlugin](./lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.md). + + +
## Variables -| Variable | Description | -| --- | --- | -| [builtInExternalsPresetDefinitions](./lynx-bundle-rslib-config.builtinexternalspresetdefinitions.md) | Built-in externals preset definitions. | -| [defaultExternalBundleLibConfig](./lynx-bundle-rslib-config.defaultexternalbundlelibconfig.md) | The default lib config for external bundle. | -| [reactLynxExternalsPreset](./lynx-bundle-rslib-config.reactlynxexternalspreset.md) | Standard ReactLynx external mappings used by the built-in `reactlynx` preset. | + + + + +
+ +Variable + + + + +Description + + +
+ +[builtInExternalsPresetDefinitions](./lynx-bundle-rslib-config.builtinexternalspresetdefinitions.md) + + + + +Built-in externals preset definitions. + + +
+ +[defaultExternalBundleLibConfig](./lynx-bundle-rslib-config.defaultexternalbundlelibconfig.md) + + + + +The default lib config for external bundle. + + +
+ +[reactLynxExternalsPreset](./lynx-bundle-rslib-config.reactlynxexternalspreset.md) + + + + +Standard ReactLynx external mappings used by the built-in `reactlynx` preset. + + +
+ +## Type Aliases + + + + + + +
+ +Type Alias + + + + +Description + + +
+ +[Externals](./lynx-bundle-rslib-config.externals.md) + + + + +External module to global-name mappings used when building Lynx external bundles. + + +
+ +[ExternalsPresetDefinitions](./lynx-bundle-rslib-config.externalspresetdefinitions.md) + + + + +Available externals preset definitions. + + +
+ +[ExternalsPresets](./lynx-bundle-rslib-config.externalspresets.md) + + + + +Enabled externals presets. + +Preset names are resolved from the built-in preset definitions plus any custom definitions passed to [defineExternalBundleRslibConfig()](./lynx-bundle-rslib-config.defineexternalbundlerslibconfig.md). + + +
+ +[OutputConfig](./lynx-bundle-rslib-config.outputconfig.md) + + + + +Output config accepted by Lynx external bundle builds. + + +
+ diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.outputconfig.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.outputconfig.md index 35b74a59b..2df9e5683 100644 --- a/docs/en/api/rspeedy/lynx-bundle-rslib-config.outputconfig.md +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.outputconfig.md @@ -2,7 +2,7 @@ [Home](./index.md) > [@lynx-js/lynx-bundle-rslib-config](./lynx-bundle-rslib-config.md) > [OutputConfig](./lynx-bundle-rslib-config.outputconfig.md) -## OutputConfig type alias +## OutputConfig type Output config accepted by Lynx external bundle builds. @@ -10,18 +10,11 @@ Output config accepted by Lynx external bundle builds. ```typescript export type OutputConfig = Required['output'] & { - externalsPresets?: ExternalsPresets; - externalsPresetDefinitions?: ExternalsPresetDefinitions; - externals?: Externals; - globalObject?: 'lynx' | 'globalThis'; + externalsPresets?: ExternalsPresets; + externalsPresetDefinitions?: ExternalsPresetDefinitions; + externals?: Externals; + globalObject?: 'lynx' | 'globalThis'; }; ``` +**References:** [ExternalsPresets](./lynx-bundle-rslib-config.externalspresets.md), [ExternalsPresetDefinitions](./lynx-bundle-rslib-config.externalspresetdefinitions.md), [Externals](./lynx-bundle-rslib-config.externals.md) -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| `externals?` | [`Externals`](./lynx-bundle-rslib-config.externals.md) | Explicit external module mappings. | -| `externalsPresetDefinitions?` | [`ExternalsPresetDefinitions`](./lynx-bundle-rslib-config.externalspresetdefinitions.md) | Definitions for custom presets enabled by `externalsPresets`. | -| `externalsPresets?` | [`ExternalsPresets`](./lynx-bundle-rslib-config.externalspresets.md) | Presets for external libraries. | -| `globalObject?` | `'lynx' \| 'globalThis'` | Global object used to mount the built library. | diff --git a/docs/en/api/rspeedy/lynx-bundle-rslib-config.reactlynxexternalspreset.md b/docs/en/api/rspeedy/lynx-bundle-rslib-config.reactlynxexternalspreset.md index 04f5099eb..f4b93f08d 100644 --- a/docs/en/api/rspeedy/lynx-bundle-rslib-config.reactlynxexternalspreset.md +++ b/docs/en/api/rspeedy/lynx-bundle-rslib-config.reactlynxexternalspreset.md @@ -9,5 +9,5 @@ Standard ReactLynx external mappings used by the built-in `reactlynx` preset. **Signature:** ```typescript -export declare const reactLynxExternalsPreset: Externals; +reactLynxExternalsPreset: Externals ``` diff --git a/docs/en/api/rspeedy/qrcode-rsbuild-plugin.md b/docs/en/api/rspeedy/qrcode-rsbuild-plugin.md index de2fb329b..19e06955e 100644 --- a/docs/en/api/rspeedy/qrcode-rsbuild-plugin.md +++ b/docs/en/api/rspeedy/qrcode-rsbuild-plugin.md @@ -8,19 +8,79 @@ A rsbuild plugin that print the template.js url using QRCode. ## Functions -| Function | Description | -| --- | --- | -| [pluginQRCode(options)](./qrcode-rsbuild-plugin.pluginqrcode.md) | Create a rsbuild plugin for printing QRCode. | + + +
+ +Function + + + + +Description + + +
+ +[pluginQRCode(options)](./qrcode-rsbuild-plugin.pluginqrcode.md) + + + + +Create a rsbuild plugin for printing QRCode. + + +
## Interfaces -| Interface | Description | -| --- | --- | -| [PluginQRCodeOptions](./qrcode-rsbuild-plugin.pluginqrcodeoptions.md) | The options for [pluginQRCode()](./qrcode-rsbuild-plugin.pluginqrcode.md). | + + +
+ +Interface + + + + +Description + + +
+ +[PluginQRCodeOptions](./qrcode-rsbuild-plugin.pluginqrcodeoptions.md) + + + + +The options for [pluginQRCode()](./qrcode-rsbuild-plugin.pluginqrcode.md). + + +
## Type Aliases -| Type Alias | Description | -| --- | --- | -| [CustomizedSchemaFn](./qrcode-rsbuild-plugin.customizedschemafn.md) | Customize the generated schema. | + + +
+ +Type Alias + + + + +Description + + +
+ +[CustomizedSchemaFn](./qrcode-rsbuild-plugin.customizedschemafn.md) + + + + +Customize the generated schema. + + +
diff --git a/docs/en/api/rspeedy/qrcode-rsbuild-plugin.pluginqrcode.md b/docs/en/api/rspeedy/qrcode-rsbuild-plugin.pluginqrcode.md index 7aefd97d5..46d226bee 100644 --- a/docs/en/api/rspeedy/qrcode-rsbuild-plugin.pluginqrcode.md +++ b/docs/en/api/rspeedy/qrcode-rsbuild-plugin.pluginqrcode.md @@ -14,9 +14,39 @@ export declare function pluginQRCode(options?: PluginQRCodeOptions): RsbuildPlug ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| options | [PluginQRCodeOptions](./qrcode-rsbuild-plugin.pluginqrcodeoptions.md) | _(Optional)_ | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +options + + + + +[PluginQRCodeOptions](./qrcode-rsbuild-plugin.pluginqrcodeoptions.md) + + + + +_(Optional)_ + + +
**Returns:** diff --git a/docs/en/api/rspeedy/qrcode-rsbuild-plugin.pluginqrcodeoptions.md b/docs/en/api/rspeedy/qrcode-rsbuild-plugin.pluginqrcodeoptions.md index 702051096..d15fa9ef0 100644 --- a/docs/en/api/rspeedy/qrcode-rsbuild-plugin.pluginqrcodeoptions.md +++ b/docs/en/api/rspeedy/qrcode-rsbuild-plugin.pluginqrcodeoptions.md @@ -14,7 +14,45 @@ export interface PluginQRCodeOptions ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [schema?](./qrcode-rsbuild-plugin.pluginqrcodeoptions.schema.md) | | [CustomizedSchemaFn](./qrcode-rsbuild-plugin.customizedschemafn.md) \| undefined | _(Optional)_ Customize the generated schema. | + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[schema?](./qrcode-rsbuild-plugin.pluginqrcodeoptions.schema.md) + + + + + + + +[CustomizedSchemaFn](./qrcode-rsbuild-plugin.customizedschemafn.md) \| undefined + + + + +_(Optional)_ Customize the generated schema. + + +
diff --git a/docs/en/api/rspeedy/react-rsbuild-plugin.addcomponentelementconfig.md b/docs/en/api/rspeedy/react-rsbuild-plugin.addcomponentelementconfig.md index 799057c89..f8cfe2eec 100644 --- a/docs/en/api/rspeedy/react-rsbuild-plugin.addcomponentelementconfig.md +++ b/docs/en/api/rspeedy/react-rsbuild-plugin.addcomponentelementconfig.md @@ -18,7 +18,45 @@ Default value: `false` ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [compilerOnly](./react-rsbuild-plugin.addcomponentelementconfig.compileronly.md) | | boolean | Whether to only add component element during compilation | + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[compilerOnly](./react-rsbuild-plugin.addcomponentelementconfig.compileronly.md) + + + + + + + +boolean + + + + +Whether to only add component element during compilation + + +
diff --git a/docs/en/api/rspeedy/react-rsbuild-plugin.compatvisitorconfig.md b/docs/en/api/rspeedy/react-rsbuild-plugin.compatvisitorconfig.md index 66ff1f76d..9d7949713 100644 --- a/docs/en/api/rspeedy/react-rsbuild-plugin.compatvisitorconfig.md +++ b/docs/en/api/rspeedy/react-rsbuild-plugin.compatvisitorconfig.md @@ -18,15 +18,197 @@ These options should only be used for migrating from ReactLynx2.0. ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [addComponentElement](./react-rsbuild-plugin.compatvisitorconfig.addcomponentelement.md) | | boolean \| [AddComponentElementConfig](./react-rsbuild-plugin.addcomponentelementconfig.md) | Controls whether to add wrapper elements for components | -| [additionalComponentAttributes](./react-rsbuild-plugin.compatvisitorconfig.additionalcomponentattributes.md) | | Array<string> | Specifies additional component attributes list, these attributes will be passed to the wrapped <view> instead of the component. | -| [componentsPkg](./react-rsbuild-plugin.compatvisitorconfig.componentspkg.md) | | Array<string> | Specifies the list of component package names that need compatibility processing | -| [darkMode?](./react-rsbuild-plugin.compatvisitorconfig.darkmode.md) | | boolean \| DarkModeConfig | _(Optional)_ | -| [disableDeprecatedWarning](./react-rsbuild-plugin.compatvisitorconfig.disabledeprecatedwarning.md) | | boolean | Whether to disable deprecated warnings | -| [newRuntimePkg](./react-rsbuild-plugin.compatvisitorconfig.newruntimepkg.md) | | string | Specifies the new runtime package name | -| [oldRuntimePkg](./react-rsbuild-plugin.compatvisitorconfig.oldruntimepkg.md) | | Array<string> | Specifies the list of old runtime package names that need compatibility processing | -| [removeComponentAttrRegex?](./react-rsbuild-plugin.compatvisitorconfig.removecomponentattrregex.md) | | string | _(Optional)_ Regular expression used to remove component attributes | -| [simplifyCtorLikeReactLynx2](./react-rsbuild-plugin.compatvisitorconfig.simplifyctorlikereactlynx2.md) | | boolean | Whether to simplify constructor calls like ReactLynx 2 | + + + + + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[addComponentElement](./react-rsbuild-plugin.compatvisitorconfig.addcomponentelement.md) + + + + + + + +boolean \| [AddComponentElementConfig](./react-rsbuild-plugin.addcomponentelementconfig.md) + + + + +Controls whether to add wrapper elements for components + + +
+ +[additionalComponentAttributes](./react-rsbuild-plugin.compatvisitorconfig.additionalcomponentattributes.md) + + + + + + + +Array<string> + + + + +Specifies additional component attributes list, these attributes will be passed to the wrapped `` instead of the component. + + +
+ +[componentsPkg](./react-rsbuild-plugin.compatvisitorconfig.componentspkg.md) + + + + + + + +Array<string> + + + + +Specifies the list of component package names that need compatibility processing + + +
+ +[darkMode?](./react-rsbuild-plugin.compatvisitorconfig.darkmode.md) + + + + + + + +boolean \| DarkModeConfig + + + + +_(Optional)_ + + +
+ +[disableDeprecatedWarning](./react-rsbuild-plugin.compatvisitorconfig.disabledeprecatedwarning.md) + + + + + + + +boolean + + + + +Whether to disable deprecated warnings + + +
+ +[newRuntimePkg](./react-rsbuild-plugin.compatvisitorconfig.newruntimepkg.md) + + + + + + + +string + + + + +Specifies the new runtime package name + + +
+ +[oldRuntimePkg](./react-rsbuild-plugin.compatvisitorconfig.oldruntimepkg.md) + + + + + + + +Array<string> + + + + +Specifies the list of old runtime package names that need compatibility processing + + +
+ +[removeComponentAttrRegex?](./react-rsbuild-plugin.compatvisitorconfig.removecomponentattrregex.md) + + + + + + + +string + + + + +_(Optional)_ Regular expression used to remove component attributes + + +
+ +[simplifyCtorLikeReactLynx2](./react-rsbuild-plugin.compatvisitorconfig.simplifyctorlikereactlynx2.md) + + + + + + + +boolean + + + + +Whether to simplify constructor calls like ReactLynx 2 + + +
diff --git a/docs/en/api/rspeedy/react-rsbuild-plugin.definedcevisitorconfig.md b/docs/en/api/rspeedy/react-rsbuild-plugin.definedcevisitorconfig.md index 7a1a2b1b4..292e18a7d 100644 --- a/docs/en/api/rspeedy/react-rsbuild-plugin.definedcevisitorconfig.md +++ b/docs/en/api/rspeedy/react-rsbuild-plugin.definedcevisitorconfig.md @@ -14,7 +14,45 @@ export interface DefineDceVisitorConfig ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [define](./react-rsbuild-plugin.definedcevisitorconfig.define.md) | | Record<string, string> | Replaces variables in your code with other values or expressions at compile time. | + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[define](./react-rsbuild-plugin.definedcevisitorconfig.define.md) + + + + + + + +Record<string, string> + + + + +Replaces variables in your code with other values or expressions at compile time. + + +
diff --git a/docs/en/api/rspeedy/react-rsbuild-plugin.extractstrconfig.md b/docs/en/api/rspeedy/react-rsbuild-plugin.extractstrconfig.md index 60e48e7d5..41dea89b2 100644 --- a/docs/en/api/rspeedy/react-rsbuild-plugin.extractstrconfig.md +++ b/docs/en/api/rspeedy/react-rsbuild-plugin.extractstrconfig.md @@ -14,7 +14,45 @@ export interface ExtractStrConfig ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [strLength](./react-rsbuild-plugin.extractstrconfig.strlength.md) | | number | The minimum length of string literals to be extracted. | + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[strLength](./react-rsbuild-plugin.extractstrconfig.strlength.md) + + + + + + + +number + + + + +The minimum length of string literals to be extracted. + + +
diff --git a/docs/en/api/rspeedy/react-rsbuild-plugin.lynxtemplateplugin.getlynxtemplatepluginhooks.md b/docs/en/api/rspeedy/react-rsbuild-plugin.lynxtemplateplugin.getlynxtemplatepluginhooks.md new file mode 100644 index 000000000..180e99199 --- /dev/null +++ b/docs/en/api/rspeedy/react-rsbuild-plugin.lynxtemplateplugin.getlynxtemplatepluginhooks.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [@lynx-js/react-rsbuild-plugin](./react-rsbuild-plugin.md) > [LynxTemplatePlugin](./react-rsbuild-plugin.lynxtemplateplugin.md) > [getLynxTemplatePluginHooks](./react-rsbuild-plugin.lynxtemplateplugin.getlynxtemplatepluginhooks.md) + +## LynxTemplatePlugin.getLynxTemplatePluginHooks property + +**Signature:** + +```typescript +getLynxTemplatePluginHooks: typeof InnerLynxTemplatePlugin.getLynxTemplatePluginHooks; +``` diff --git a/docs/en/api/rspeedy/react-rsbuild-plugin.lynxtemplateplugin.md b/docs/en/api/rspeedy/react-rsbuild-plugin.lynxtemplateplugin.md new file mode 100644 index 000000000..723e5cba6 --- /dev/null +++ b/docs/en/api/rspeedy/react-rsbuild-plugin.lynxtemplateplugin.md @@ -0,0 +1,54 @@ + + +[Home](./index.md) > [@lynx-js/react-rsbuild-plugin](./react-rsbuild-plugin.md) > [LynxTemplatePlugin](./react-rsbuild-plugin.lynxtemplateplugin.md) + +## LynxTemplatePlugin interface + +**Signature:** + +```typescript +interface LynxTemplatePlugin +``` + +## Properties + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[getLynxTemplatePluginHooks](./react-rsbuild-plugin.lynxtemplateplugin.getlynxtemplatepluginhooks.md) + + + + + + + +typeof InnerLynxTemplatePlugin.getLynxTemplatePluginHooks + + + + + +
+ diff --git a/docs/en/api/rspeedy/react-rsbuild-plugin.md b/docs/en/api/rspeedy/react-rsbuild-plugin.md index 8aabb1936..f9f27df24 100644 --- a/docs/en/api/rspeedy/react-rsbuild-plugin.md +++ b/docs/en/api/rspeedy/react-rsbuild-plugin.md @@ -8,18 +8,117 @@ A rsbuild plugin that integrates with ReactLynx. ## Functions -| Function | Description | -| --- | --- | -| [pluginReactLynx(userOptions)](./react-rsbuild-plugin.pluginreactlynx.md) | Create a rsbuild plugin for ReactLynx. | + + +
+ +Function + + + + +Description + + +
+ +[pluginReactLynx(userOptions)](./react-rsbuild-plugin.pluginreactlynx.md) + + + + +Create a rsbuild plugin for ReactLynx. + + +
## Interfaces -| Interface | Description | -| --- | --- | -| [AddComponentElementConfig](./react-rsbuild-plugin.addcomponentelementconfig.md) | Controls whether to add wrapper elements for components | -| [CompatVisitorConfig](./react-rsbuild-plugin.compatvisitorconfig.md) | The compat option controls compatibilities with ReactLynx2.0. | -| [DefineDceVisitorConfig](./react-rsbuild-plugin.definedcevisitorconfig.md) | Like define in various bundlers, but this one happens at transform time, and a DCE pass will be performed. | -| [ExtractStrConfig](./react-rsbuild-plugin.extractstrconfig.md) | Merge same string literals in JS and Lepus to reduce output bundle size. Set to false to disable. | -| [PluginReactLynxOptions](./react-rsbuild-plugin.pluginreactlynxoptions.md) | Options of [pluginReactLynx()](./react-rsbuild-plugin.pluginreactlynx.md) | -| [ShakeVisitorConfig](./react-rsbuild-plugin.shakevisitorconfig.md) | How main-thread code will be shaken. | + + + + + + + + +
+ +Interface + + + + +Description + + +
+ +[AddComponentElementConfig](./react-rsbuild-plugin.addcomponentelementconfig.md) + + + + +Controls whether to add wrapper elements for components + + +
+ +[CompatVisitorConfig](./react-rsbuild-plugin.compatvisitorconfig.md) + + + + +The `compat` option controls compatibilities with ReactLynx2.0. + + +
+ +[DefineDceVisitorConfig](./react-rsbuild-plugin.definedcevisitorconfig.md) + + + + +Like `define` in various bundlers, but this one happens at transform time, and a DCE pass will be performed. + + +
+ +[ExtractStrConfig](./react-rsbuild-plugin.extractstrconfig.md) + + + + +Merge same string literals in JS and Lepus to reduce output bundle size. Set to `false` to disable. + + +
+ +[LynxTemplatePlugin](./react-rsbuild-plugin.lynxtemplateplugin.md) + + + + + +
+ +[PluginReactLynxOptions](./react-rsbuild-plugin.pluginreactlynxoptions.md) + + + + +Options of [pluginReactLynx()](./react-rsbuild-plugin.pluginreactlynx.md) + + +
+ +[ShakeVisitorConfig](./react-rsbuild-plugin.shakevisitorconfig.md) + + + + +How main-thread code will be shaken. + + +
diff --git a/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynx.md b/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynx.md index c6c233f85..f2958a08a 100644 --- a/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynx.md +++ b/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynx.md @@ -14,9 +14,39 @@ export declare function pluginReactLynx(userOptions?: PluginReactLynxOptions): R ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| userOptions | [PluginReactLynxOptions](./react-rsbuild-plugin.pluginreactlynxoptions.md) | _(Optional)_ | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +userOptions + + + + +[PluginReactLynxOptions](./react-rsbuild-plugin.pluginreactlynxoptions.md) + + + + +_(Optional)_ + + +
**Returns:** diff --git a/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.enablenewgesture.md b/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.enablenewgesture.md index 01caacbfc..496ac807a 100644 --- a/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.enablenewgesture.md +++ b/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.enablenewgesture.md @@ -11,3 +11,8 @@ enableNewGesture enables the new gesture system. ```typescript enableNewGesture?: boolean; ``` + +## Default Value + +`false` + diff --git a/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.enableremovecssscope.md b/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.enableremovecssscope.md index f9c7dbf24..8f806a4db 100644 --- a/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.enableremovecssscope.md +++ b/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.enableremovecssscope.md @@ -17,3 +17,8 @@ enableRemoveCSSScope controls whether CSS is restrict to use in the component sc ```typescript enableRemoveCSSScope?: boolean | undefined; ``` + +## Default Value + +`true` + diff --git a/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.enablessr.md b/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.enablessr.md index a1721e902..63df873d6 100644 --- a/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.enablessr.md +++ b/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.enablessr.md @@ -11,3 +11,8 @@ ```typescript enableSSR?: boolean; ``` + +## Default Value + +`false` + diff --git a/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.extractstr.md b/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.extractstr.md index fcce1ff83..129417962 100644 --- a/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.extractstr.md +++ b/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.extractstr.md @@ -11,3 +11,8 @@ Merge same string literals in JS and Lepus to reduce output bundle size. Set to ```typescript extractStr?: Partial | boolean; ``` + +## Default Value + +false + diff --git a/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.firstscreensynctiming.md b/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.firstscreensynctiming.md index 34f096c90..a20b27b53 100644 --- a/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.firstscreensynctiming.md +++ b/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.firstscreensynctiming.md @@ -19,3 +19,8 @@ After handing over control, MainThread (Lepus) runtime can no longer respond to ```typescript firstScreenSyncTiming?: 'immediately' | 'jsReady'; ``` + +## Default Value + +"immediately" + diff --git a/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.globalpropsmode.md b/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.globalpropsmode.md new file mode 100644 index 000000000..6ecf1d456 --- /dev/null +++ b/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.globalpropsmode.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [@lynx-js/react-rsbuild-plugin](./react-rsbuild-plugin.md) > [PluginReactLynxOptions](./react-rsbuild-plugin.pluginreactlynxoptions.md) > [globalPropsMode](./react-rsbuild-plugin.pluginreactlynxoptions.globalpropsmode.md) + +## PluginReactLynxOptions.globalPropsMode property + +Configure the update mode of `lynx.__globalProps`. + +This flag has two options: + +`'reactive'`: `UpdateGlobalProps` will trigger update automatically. + +`'event'`: `UpdateGlobalProps` will trigger global event and users need to trigger update in the event handler. + +**Signature:** + +```typescript +globalPropsMode?: 'reactive' | 'event'; +``` + +## Default Value + +`'reactive'` + diff --git a/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.md b/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.md index 2f9f8a658..5e07f29fa 100644 --- a/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.md +++ b/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.md @@ -14,28 +14,447 @@ export interface PluginReactLynxOptions ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [compat?](./react-rsbuild-plugin.pluginreactlynxoptions.compat.md) | | Partial<[CompatVisitorConfig](./react-rsbuild-plugin.compatvisitorconfig.md)> & { disableCreateSelectorQueryIncompatibleWarning?: boolean; } \| undefined | _(Optional)_ The compat option controls compatibilities with ReactLynx2.0. | -| [customCSSInheritanceList?](./react-rsbuild-plugin.pluginreactlynxoptions.customcssinheritancelist.md) | | string\[\] \| undefined | _(Optional)_ When [PluginReactLynxOptions.enableCSSInheritance](./react-rsbuild-plugin.pluginreactlynxoptions.enablecssinheritance.md) is enabled, customCSSInheritanceList can control which properties are inheritable, not just the default ones. | -| [debugInfoOutside?](./react-rsbuild-plugin.pluginreactlynxoptions.debuginfooutside.md) | | boolean | _(Optional)_ debugInfoOutside controls whether the debug info is placed outside the template. | -| [defaultDisplayLinear?](./react-rsbuild-plugin.pluginreactlynxoptions.defaultdisplaylinear.md) | | boolean | _(Optional)_ defaultDisplayLinear controls whether the default value of display in CSS is linear. | -| [defineDCE?](./react-rsbuild-plugin.pluginreactlynxoptions.definedce.md) | | Partial<[DefineDceVisitorConfig](./react-rsbuild-plugin.definedcevisitorconfig.md)> \| undefined | _(Optional)_ Like define in various bundlers, but this one happens at transform time, and a DCE pass will be performed. | -| [enableAccessibilityElement?](./react-rsbuild-plugin.pluginreactlynxoptions.enableaccessibilityelement.md) | | boolean | _(Optional)_ enableAccessibilityElement set the default value of accessibility-element for all <view /> elements. | -| [enableCSSInheritance?](./react-rsbuild-plugin.pluginreactlynxoptions.enablecssinheritance.md) | | boolean | _(Optional)_ enableCSSInheritance enables the default inheritance properties. | -| [enableCSSInvalidation?](./react-rsbuild-plugin.pluginreactlynxoptions.enablecssinvalidation.md) | | boolean | _(Optional)_ CSS Invalidation refers to the process of determining which elements need to have their styles recalculated when the DOM is updated. | -| [enableCSSSelector?](./react-rsbuild-plugin.pluginreactlynxoptions.enablecssselector.md) | | boolean | _(Optional)_ enableCSSSelector controls whether enabling the new CSS implementation. | -| [enableICU?](./react-rsbuild-plugin.pluginreactlynxoptions.enableicu.md) | | boolean |

_(Optional)_ enableICU enables the Intl API to be enabled globally.

If enabled, please double check the compatibility with Lynx Share Context feature to avoid using shared Intl API from other destroyed card.

| -| [enableNewGesture?](./react-rsbuild-plugin.pluginreactlynxoptions.enablenewgesture.md) | | boolean | _(Optional)_ enableNewGesture enables the new gesture system. | -| [enableParallelElement?](./react-rsbuild-plugin.pluginreactlynxoptions.enableparallelelement.md) | | boolean | _(Optional)_ enableParallelElement enables Threaded Element Resolution. | -| [enableRemoveCSSScope?](./react-rsbuild-plugin.pluginreactlynxoptions.enableremovecssscope.md) | | boolean \| undefined |

_(Optional)_ enableRemoveCSSScope controls whether CSS is restrict to use in the component scope.

true: All CSS files are treated as global CSS.

false: All CSS files are treated as scoped CSS, and only take effect in the component that explicitly imports it.

undefined: Only use scoped CSS for CSS Modules, and treat other CSS files as global CSS. Scoped CSS is faster than global CSS, thus you can use CSS Modules to speedy up your CSS if there are performance issues.

| -| [enableSSR?](./react-rsbuild-plugin.pluginreactlynxoptions.enablessr.md) | | boolean | _(Optional)_ enableSSR enable Lynx SSR feature for this build. | -| [engineVersion?](./react-rsbuild-plugin.pluginreactlynxoptions.engineversion.md) | | string | _(Optional)_ engineVersion specifies the minimum Lynx Engine version required for an App bundle to function properly. | -| [experimental\_isLazyBundle?](./react-rsbuild-plugin.pluginreactlynxoptions.experimental_islazybundle.md) | | boolean | **_(ALPHA)_** _(Optional)_ Generate standalone lazy bundle. | -| [extractStr?](./react-rsbuild-plugin.pluginreactlynxoptions.extractstr.md) | | Partial<[ExtractStrConfig](./react-rsbuild-plugin.extractstrconfig.md)> \| boolean | _(Optional)_ Merge same string literals in JS and Lepus to reduce output bundle size. Set to false to disable. | -| [firstScreenSyncTiming?](./react-rsbuild-plugin.pluginreactlynxoptions.firstscreensynctiming.md) | | 'immediately' \| 'jsReady' |

_(Optional)_ This flag controls when MainThread (Lepus) transfers control to Background after the first screen

This flag has two options:

"immediately": Transfer immediately

"jsReady": Transfer when background (JS Runtime) is ready

After handing over control, MainThread (Lepus) runtime can no longer respond to data updates, and data updates will be forwarded to background (JS Runtime) and processed \_\_asynchronously\_\_

| -| [pipelineSchedulerConfig?](./react-rsbuild-plugin.pluginreactlynxoptions.pipelineschedulerconfig.md) | | number | _(Optional)_ Composite configuration representing pipeline scheduling strategies, including [PluginReactLynxOptions.enableParallelElement](./react-rsbuild-plugin.pluginreactlynxoptions.enableparallelelement.md) and list batch-rendering. All newly introduced scheduling strategies will be managed by this uint64 configuration. | -| [removeDescendantSelectorScope?](./react-rsbuild-plugin.pluginreactlynxoptions.removedescendantselectorscope.md) | | boolean | _(Optional)_ removeDescendantSelectorScope is used to remove the scope of descendant selectors. | -| [shake?](./react-rsbuild-plugin.pluginreactlynxoptions.shake.md) | | Partial<[ShakeVisitorConfig](./react-rsbuild-plugin.shakevisitorconfig.md)> \| undefined | _(Optional)_ How main-thread code will be shaken. | -| [targetSdkVersion?](./react-rsbuild-plugin.pluginreactlynxoptions.targetsdkversion.md) | | string | _(Optional)_ targetSdkVersion is used to specify the minimal Lynx Engine version that a App bundle can run on. | + + + + + + + + + + + + + + + + + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[compat?](./react-rsbuild-plugin.pluginreactlynxoptions.compat.md) + + + + + + + +Partial<[CompatVisitorConfig](./react-rsbuild-plugin.compatvisitorconfig.md)> & { disableCreateSelectorQueryIncompatibleWarning?: boolean; } \| undefined + + + + +_(Optional)_ The `compat` option controls compatibilities with ReactLynx2.0. + + +
+ +[customCSSInheritanceList?](./react-rsbuild-plugin.pluginreactlynxoptions.customcssinheritancelist.md) + + + + + + + +string\[\] \| undefined + + + + +_(Optional)_ When [PluginReactLynxOptions.enableCSSInheritance](./react-rsbuild-plugin.pluginreactlynxoptions.enablecssinheritance.md) is enabled, `customCSSInheritanceList` can control which properties are inheritable, not just the default ones. + + +
+ +[debugInfoOutside?](./react-rsbuild-plugin.pluginreactlynxoptions.debuginfooutside.md) + + + + + + + +boolean + + + + +_(Optional)_ debugInfoOutside controls whether the debug info is placed outside the template. + + +
+ +[defaultDisplayLinear?](./react-rsbuild-plugin.pluginreactlynxoptions.defaultdisplaylinear.md) + + + + + + + +boolean + + + + +_(Optional)_ defaultDisplayLinear controls whether the default value of `display` in CSS is `linear`. + + +
+ +[defineDCE?](./react-rsbuild-plugin.pluginreactlynxoptions.definedce.md) + + + + + + + +Partial<[DefineDceVisitorConfig](./react-rsbuild-plugin.definedcevisitorconfig.md)> \| undefined + + + + +_(Optional)_ Like `define` in various bundlers, but this one happens at transform time, and a DCE pass will be performed. + + +
+ +[enableAccessibilityElement?](./react-rsbuild-plugin.pluginreactlynxoptions.enableaccessibilityelement.md) + + + + + + + +boolean + + + + +_(Optional)_ enableAccessibilityElement set the default value of `accessibility-element` for all `` elements. + + +
+ +[enableCSSInheritance?](./react-rsbuild-plugin.pluginreactlynxoptions.enablecssinheritance.md) + + + + + + + +boolean + + + + +_(Optional)_ enableCSSInheritance enables the default inheritance properties. + + +
+ +[enableCSSInvalidation?](./react-rsbuild-plugin.pluginreactlynxoptions.enablecssinvalidation.md) + + + + + + + +boolean + + + + +_(Optional)_ CSS Invalidation refers to the process of determining which elements need to have their styles recalculated when the DOM is updated. + + +
+ +[enableCSSSelector?](./react-rsbuild-plugin.pluginreactlynxoptions.enablecssselector.md) + + + + + + + +boolean + + + + +_(Optional)_ enableCSSSelector controls whether enabling the new CSS implementation. + + +
+ +[enableNewGesture?](./react-rsbuild-plugin.pluginreactlynxoptions.enablenewgesture.md) + + + + + + + +boolean + + + + +_(Optional)_ enableNewGesture enables the new gesture system. + + +
+ +[enableRemoveCSSScope?](./react-rsbuild-plugin.pluginreactlynxoptions.enableremovecssscope.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ enableRemoveCSSScope controls whether CSS is restrict to use in the component scope. + +`true`: All CSS files are treated as global CSS. + +`false`: All CSS files are treated as scoped CSS, and only take effect in the component that explicitly imports it. + +`undefined`: Only use scoped CSS for CSS Modules, and treat other CSS files as global CSS. Scoped CSS is faster than global CSS, thus you can use CSS Modules to speedy up your CSS if there are performance issues. + + +
+ +[enableSSR?](./react-rsbuild-plugin.pluginreactlynxoptions.enablessr.md) + + + + + + + +boolean + + + + +_(Optional)_ `enableSSR` enable Lynx SSR feature for this build. + + +
+ +[engineVersion?](./react-rsbuild-plugin.pluginreactlynxoptions.engineversion.md) + + + + + + + +string + + + + +_(Optional)_ `engineVersion` specifies the minimum Lynx Engine version required for an App bundle to function properly. + + +
+ +[experimental\_isLazyBundle?](./react-rsbuild-plugin.pluginreactlynxoptions.experimental_islazybundle.md) + + + + + + + +boolean + + + + +**_(ALPHA)_** _(Optional)_ Generate standalone lazy bundle. + + +
+ +[extractStr?](./react-rsbuild-plugin.pluginreactlynxoptions.extractstr.md) + + + + + + + +Partial<[ExtractStrConfig](./react-rsbuild-plugin.extractstrconfig.md)> \| boolean + + + + +_(Optional)_ Merge same string literals in JS and Lepus to reduce output bundle size. Set to `false` to disable. + + +
+ +[firstScreenSyncTiming?](./react-rsbuild-plugin.pluginreactlynxoptions.firstscreensynctiming.md) + + + + + + + +'immediately' \| 'jsReady' + + + + +_(Optional)_ This flag controls when MainThread (Lepus) transfers control to Background after the first screen + +This flag has two options: + +`"immediately"`: Transfer immediately + +`"jsReady"`: Transfer when background (JS Runtime) is ready + +After handing over control, MainThread (Lepus) runtime can no longer respond to data updates, and data updates will be forwarded to background (JS Runtime) and processed \_\_asynchronously\_\_ + + +
+ +[globalPropsMode?](./react-rsbuild-plugin.pluginreactlynxoptions.globalpropsmode.md) + + + + + + + +'reactive' \| 'event' + + + + +_(Optional)_ Configure the update mode of `lynx.__globalProps`. + +This flag has two options: + +`'reactive'`: `UpdateGlobalProps` will trigger update automatically. + +`'event'`: `UpdateGlobalProps` will trigger global event and users need to trigger update in the event handler. + + +
+ +[optimizeBundleSize?](./react-rsbuild-plugin.pluginreactlynxoptions.optimizebundlesize.md) + + + + + + + +boolean \| { mainThread?: boolean; background?: boolean; } + + + + +_(Optional)_ Optimize bundle size by removing unused code by Minify.mainThreadOptions and Minify.backgroundOptions. + +When optimizeBundleSize or optimizeBundleSize.mainThread is true, main-thread code will be optimized. When optimizeBundleSize or optimizeBundleSize.background is true, background code will be optimized. + + +
+ +[removeDescendantSelectorScope?](./react-rsbuild-plugin.pluginreactlynxoptions.removedescendantselectorscope.md) + + + + + + + +boolean + + + + +_(Optional)_ removeDescendantSelectorScope is used to remove the scope of descendant selectors. + + +
+ +[shake?](./react-rsbuild-plugin.pluginreactlynxoptions.shake.md) + + + + + + + +Partial<[ShakeVisitorConfig](./react-rsbuild-plugin.shakevisitorconfig.md)> \| undefined + + + + +_(Optional)_ How main-thread code will be shaken. + + +
+ +[targetSdkVersion?](./react-rsbuild-plugin.pluginreactlynxoptions.targetsdkversion.md) + + + + + + + +string + + + + +_(Optional)_ targetSdkVersion is used to specify the minimal Lynx Engine version that a App bundle can run on. + + +
diff --git a/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.optimizebundlesize.md b/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.optimizebundlesize.md new file mode 100644 index 000000000..b303fab30 --- /dev/null +++ b/docs/en/api/rspeedy/react-rsbuild-plugin.pluginreactlynxoptions.optimizebundlesize.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [@lynx-js/react-rsbuild-plugin](./react-rsbuild-plugin.md) > [PluginReactLynxOptions](./react-rsbuild-plugin.pluginreactlynxoptions.md) > [optimizeBundleSize](./react-rsbuild-plugin.pluginreactlynxoptions.optimizebundlesize.md) + +## PluginReactLynxOptions.optimizeBundleSize property + +Optimize bundle size by removing unused code by Minify.mainThreadOptions and Minify.backgroundOptions. + +When optimizeBundleSize or optimizeBundleSize.mainThread is true, main-thread code will be optimized. When optimizeBundleSize or optimizeBundleSize.background is true, background code will be optimized. + +**Signature:** + +```typescript +optimizeBundleSize?: boolean | { + mainThread?: boolean; + background?: boolean; + }; +``` + +## Default Value + +`false` + diff --git a/docs/en/api/rspeedy/react-rsbuild-plugin.shakevisitorconfig.md b/docs/en/api/rspeedy/react-rsbuild-plugin.shakevisitorconfig.md index df1a4a621..06ec83f61 100644 --- a/docs/en/api/rspeedy/react-rsbuild-plugin.shakevisitorconfig.md +++ b/docs/en/api/rspeedy/react-rsbuild-plugin.shakevisitorconfig.md @@ -14,9 +14,102 @@ export interface ShakeVisitorConfig ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [pkgName](./react-rsbuild-plugin.shakevisitorconfig.pkgname.md) | | Array<string> | Package names to identify runtime imports that need to be processed | -| [removeCallParams](./react-rsbuild-plugin.shakevisitorconfig.removecallparams.md) | | Array<string> | Function names whose parameters should be removed during transformation | -| [retainProp](./react-rsbuild-plugin.shakevisitorconfig.retainprop.md) | | Array<string> | Properties that should be retained in the component class | + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[pkgName](./react-rsbuild-plugin.shakevisitorconfig.pkgname.md) + + + + + + + +Array<string> + + + + +Package names to identify runtime imports that need to be processed + + +
+ +[removeCall](./react-rsbuild-plugin.shakevisitorconfig.removecall.md) + + + + + + + +Array<string> + + + + +Function names whose calls should be replaced with `undefined` during transformation + + +
+ +[removeCallParams](./react-rsbuild-plugin.shakevisitorconfig.removecallparams.md) + + + + + + + +Array<string> + + + + +Function names whose parameters should be removed during transformation + + +
+ +[retainProp](./react-rsbuild-plugin.shakevisitorconfig.retainprop.md) + + + + + + + +Array<string> + + + + +Properties that should be retained in the component class + + +
diff --git a/docs/en/api/rspeedy/react-rsbuild-plugin.shakevisitorconfig.removecall.md b/docs/en/api/rspeedy/react-rsbuild-plugin.shakevisitorconfig.removecall.md new file mode 100644 index 000000000..fbb203445 --- /dev/null +++ b/docs/en/api/rspeedy/react-rsbuild-plugin.shakevisitorconfig.removecall.md @@ -0,0 +1,36 @@ + + +[Home](./index.md) > [@lynx-js/react-rsbuild-plugin](./react-rsbuild-plugin.md) > [ShakeVisitorConfig](./react-rsbuild-plugin.shakevisitorconfig.md) > [removeCall](./react-rsbuild-plugin.shakevisitorconfig.removecall.md) + +## ShakeVisitorConfig.removeCall property + +Function names whose calls should be replaced with `undefined` during transformation + +**Signature:** + +```typescript +removeCall: Array +``` + +## Remarks + +Default value: `['useEffect', 'useLayoutEffect', '__runInJS', 'useLynxGlobalEventListener', 'useImperativeHandle']` The provided values will be merged with the default values instead of replacing them. + +## Example + + +```js +import { defineConfig } from '@lynx-js/rspeedy' +import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin' + +export default defineConfig({ + plugins: [ + pluginReactLynx({ + shake: { + removeCall: ['useMyCustomEffect'] + } + }) + ] +}) +``` + diff --git a/docs/en/api/rspeedy/react-rsbuild-plugin.shakevisitorconfig.removecallparams.md b/docs/en/api/rspeedy/react-rsbuild-plugin.shakevisitorconfig.removecallparams.md index ff863535d..cfdaa52f5 100644 --- a/docs/en/api/rspeedy/react-rsbuild-plugin.shakevisitorconfig.removecallparams.md +++ b/docs/en/api/rspeedy/react-rsbuild-plugin.shakevisitorconfig.removecallparams.md @@ -14,7 +14,7 @@ removeCallParams: Array ## Remarks -Default value: `['useEffect', 'useLayoutEffect', '__runInJS', 'useLynxGlobalEventListener', 'useImperativeHandle']` The provided values will be merged with the default values instead of replacing them. +Default value: `[]` The provided values will be merged with the default values instead of replacing them. ## Example diff --git a/docs/en/api/rspeedy/rspeedy.buildcache.cachedigest.md b/docs/en/api/rspeedy/rspeedy.buildcache.cachedigest.md index d0213b8a6..7b909e178 100644 --- a/docs/en/api/rspeedy/rspeedy.buildcache.cachedigest.md +++ b/docs/en/api/rspeedy/rspeedy.buildcache.cachedigest.md @@ -15,6 +15,10 @@ Add additional cache digests, the previous build cache will be invalidated when cacheDigest?: Array | undefined; ``` +## Default Value + +undefined + ## Example Add `process.env.SOME_ENV` to the cache digest. diff --git a/docs/en/api/rspeedy/rspeedy.buildcache.cachedirectory.md b/docs/en/api/rspeedy/rspeedy.buildcache.cachedirectory.md index b90764d90..d5a2fa863 100644 --- a/docs/en/api/rspeedy/rspeedy.buildcache.cachedirectory.md +++ b/docs/en/api/rspeedy/rspeedy.buildcache.cachedirectory.md @@ -14,3 +14,8 @@ The output directory of the cache files. ```typescript cacheDirectory?: string | undefined; ``` + +## Default Value + +'node\_modules/.cache' + diff --git a/docs/en/api/rspeedy/rspeedy.buildcache.md b/docs/en/api/rspeedy/rspeedy.buildcache.md index 655115d75..3022c0de5 100644 --- a/docs/en/api/rspeedy/rspeedy.buildcache.md +++ b/docs/en/api/rspeedy/rspeedy.buildcache.md @@ -19,9 +19,83 @@ export interface BuildCache ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [buildDependencies?](./rspeedy.buildcache.builddependencies.md) | | string\[\] \| undefined | **_(BETA)_** _(Optional)_ An array of files containing build dependencies. Rspack will use the hash of each of these files to invalidate the persistent cache. | -| [cacheDigest?](./rspeedy.buildcache.cachedigest.md) | | Array<string \| undefined> \| undefined | **_(BETA)_** _(Optional)_ Add additional cache digests, the previous build cache will be invalidated when any value in the array changes. | -| [cacheDirectory?](./rspeedy.buildcache.cachedirectory.md) | | string \| undefined | **_(BETA)_** _(Optional)_ The output directory of the cache files. | + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[buildDependencies?](./rspeedy.buildcache.builddependencies.md) + + + + + + + +string\[\] \| undefined + + + + +**_(BETA)_** _(Optional)_ An array of files containing build dependencies. Rspack will use the hash of each of these files to invalidate the persistent cache. + + +
+ +[cacheDigest?](./rspeedy.buildcache.cachedigest.md) + + + + + + + +Array<string \| undefined> \| undefined + + + + +**_(BETA)_** _(Optional)_ Add additional cache digests, the previous build cache will be invalidated when any value in the array changes. + + +
+ +[cacheDirectory?](./rspeedy.buildcache.cachedirectory.md) + + + + + + + +string \| undefined + + + + +**_(BETA)_** _(Optional)_ The output directory of the cache files. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.chunksplit.md b/docs/en/api/rspeedy/rspeedy.chunksplit.md index 5f208c134..dd4097948 100644 --- a/docs/en/api/rspeedy/rspeedy.chunksplit.md +++ b/docs/en/api/rspeedy/rspeedy.chunksplit.md @@ -14,8 +14,64 @@ export interface ChunkSplit ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [override?](./rspeedy.chunksplit.override.md) | | Rspack.Configuration extends { optimization?: { splitChunks?: infer P; } \| undefined; } ? P : never | _(Optional)_ Custom Rspack chunk splitting config can be specified. | -| [strategy?](./rspeedy.chunksplit.strategy.md) | | 'all-in-one' \| 'split-by-module' \| 'split-by-experience' \| 'single-vendor' \| undefined | _(Optional)_ The ChunkSplitting strategy. | + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[override?](./rspeedy.chunksplit.override.md) + + + + + + + +Rspack.Configuration extends { optimization?: { splitChunks?: infer P; } \| undefined; } ? P : never + + + + +_(Optional)_ Custom Rspack chunk splitting config can be specified. + + +
+ +[strategy?](./rspeedy.chunksplit.strategy.md) + + + + + + + +'all-in-one' \| 'split-by-module' \| 'split-by-experience' \| 'single-vendor' \| undefined + + + + +_(Optional)_ The ChunkSplitting strategy. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.chunksplitbysize.md b/docs/en/api/rspeedy/rspeedy.chunksplitbysize.md index 075a55246..4081b3a46 100644 --- a/docs/en/api/rspeedy/rspeedy.chunksplitbysize.md +++ b/docs/en/api/rspeedy/rspeedy.chunksplitbysize.md @@ -14,10 +14,102 @@ export interface ChunkSplitBySize ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [maxSize?](./rspeedy.chunksplitbysize.maxsize.md) | | number \| undefined | _(Optional)_ The maximum size of a chunk, unit in bytes. Defaults to Number.POSITIVE_INFINITY. | -| [minSize?](./rspeedy.chunksplitbysize.minsize.md) | | number \| undefined | _(Optional)_ The minimum size of a chunk, unit in bytes. Defaults to 10000. | -| [override?](./rspeedy.chunksplitbysize.override.md) | | Rspack.Configuration extends { optimization?: { splitChunks?: infer P; } \| undefined; } ? P : never | _(Optional)_ Custom Rspack chunk splitting config can be specified. | -| [strategy](./rspeedy.chunksplitbysize.strategy.md) | | 'split-by-size' | The ChunkSplitting strategy. | + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[maxSize?](./rspeedy.chunksplitbysize.maxsize.md) + + + + + + + +number \| undefined + + + + +_(Optional)_ The maximum size of a chunk, unit in bytes. Defaults to `Number.POSITIVE_INFINITY`. + + +
+ +[minSize?](./rspeedy.chunksplitbysize.minsize.md) + + + + + + + +number \| undefined + + + + +_(Optional)_ The minimum size of a chunk, unit in bytes. Defaults to `10000`. + + +
+ +[override?](./rspeedy.chunksplitbysize.override.md) + + + + + + + +Rspack.Configuration extends { optimization?: { splitChunks?: infer P; } \| undefined; } ? P : never + + + + +_(Optional)_ Custom Rspack chunk splitting config can be specified. + + +
+ +[strategy](./rspeedy.chunksplitbysize.strategy.md) + + + + + + + +'split-by-size' + + + + +The ChunkSplitting strategy. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.chunksplitcustom.md b/docs/en/api/rspeedy/rspeedy.chunksplitcustom.md index f6b53e620..b07c66893 100644 --- a/docs/en/api/rspeedy/rspeedy.chunksplitcustom.md +++ b/docs/en/api/rspeedy/rspeedy.chunksplitcustom.md @@ -14,8 +14,64 @@ export interface ChunkSplitCustom ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [splitChunks?](./rspeedy.chunksplitcustom.splitchunks.md) | | Rspack.Configuration extends { optimization?: { splitChunks?: infer P; } \| undefined; } ? P : never | _(Optional)_ Custom Rspack chunk splitting config can be specified. | -| [strategy](./rspeedy.chunksplitcustom.strategy.md) | | 'custom' | The ChunkSplitting strategy. | + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[splitChunks?](./rspeedy.chunksplitcustom.splitchunks.md) + + + + + + + +Rspack.Configuration extends { optimization?: { splitChunks?: infer P; } \| undefined; } ? P : never + + + + +_(Optional)_ Custom Rspack chunk splitting config can be specified. + + +
+ +[strategy](./rspeedy.chunksplitcustom.strategy.md) + + + + + + + +'custom' + + + + +The ChunkSplitting strategy. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.config.md b/docs/en/api/rspeedy/rspeedy.config.md index 0bb667fb3..6d3ad98d8 100644 --- a/docs/en/api/rspeedy/rspeedy.config.md +++ b/docs/en/api/rspeedy/rspeedy.config.md @@ -14,16 +14,216 @@ export interface Config ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [dev?](./rspeedy.config.dev.md) | | [Dev](./rspeedy.dev.md) \| undefined | _(Optional)_ The [Dev](./rspeedy.dev.md) option is used to control the behavior related with development. Including: HMR, DevServer, etc. | -| [environments?](./rspeedy.config.environments.md) | | RsbuildConfig\['environments'\] \| undefined | _(Optional)_ The [Config.environments](./rspeedy.config.environments.md) option is used to set the output environment. | -| [mode?](./rspeedy.config.mode.md) | | 'development' \| 'production' \| 'none' \| undefined | _(Optional)_ Specify the build mode for Rsbuild and Rspack, as each mode has different default behavior and optimizations. | -| [output?](./rspeedy.config.output.md) | | [Output](./rspeedy.output.md) \| undefined | _(Optional)_ The [Output](./rspeedy.output.md) option is used to set how and where should the bundles and assets output. | -| [performance?](./rspeedy.config.performance.md) | | [Performance](./rspeedy.performance.md) \| undefined | _(Optional)_ The [Performance](./rspeedy.performance.md) option is used to optimize the build-time and runtime performance. | -| [plugins?](./rspeedy.config.plugins.md) | | RsbuildPlugins \| undefined | _(Optional)_ The plugins option is used to customize the build process in a variety of ways. | -| [resolve?](./rspeedy.config.resolve.md) | | [Resolve](./rspeedy.resolve.md) \| undefined | _(Optional)_ The [Resolve](./rspeedy.resolve.md) option is used to control the resolution behavior of Rspack. | -| [server?](./rspeedy.config.server.md) | | [Server](./rspeedy.server.md) \| undefined | _(Optional)_ The [Server](./rspeedy.server.md) option changes the behavior of dev-server. | -| [source?](./rspeedy.config.source.md) | | [Source](./rspeedy.source.md) \| undefined | _(Optional)_ The [Source](./rspeedy.source.md) option changes the behavior of source files. | -| [tools?](./rspeedy.config.tools.md) | | [Tools](./rspeedy.tools.md) \| undefined | _(Optional)_ The [Tools](./rspeedy.tools.md) options changes the behavior of various building tools. | + + + + + + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[dev?](./rspeedy.config.dev.md) + + + + + + + +[Dev](./rspeedy.dev.md) \| undefined + + + + +_(Optional)_ The [Dev](./rspeedy.dev.md) option is used to control the behavior related with development. Including: HMR, DevServer, etc. + + +
+ +[environments?](./rspeedy.config.environments.md) + + + + + + + +RsbuildConfig\['environments'\] \| undefined + + + + +_(Optional)_ The [Config.environments](./rspeedy.config.environments.md) option is used to set the output environment. + + +
+ +[mode?](./rspeedy.config.mode.md) + + + + + + + +'development' \| 'production' \| 'none' \| undefined + + + + +_(Optional)_ Specify the build mode for Rsbuild and Rspack, as each mode has different default behavior and optimizations. + + +
+ +[output?](./rspeedy.config.output.md) + + + + + + + +[Output](./rspeedy.output.md) \| undefined + + + + +_(Optional)_ The [Output](./rspeedy.output.md) option is used to set how and where should the bundles and assets output. + + +
+ +[performance?](./rspeedy.config.performance.md) + + + + + + + +[Performance](./rspeedy.performance.md) \| undefined + + + + +_(Optional)_ The [Performance](./rspeedy.performance.md) option is used to optimize the build-time and runtime performance. + + +
+ +[plugins?](./rspeedy.config.plugins.md) + + + + + + + +RsbuildPlugins \| undefined + + + + +_(Optional)_ The `plugins` option is used to customize the build process in a variety of ways. + + +
+ +[resolve?](./rspeedy.config.resolve.md) + + + + + + + +[Resolve](./rspeedy.resolve.md) \| undefined + + + + +_(Optional)_ The [Resolve](./rspeedy.resolve.md) option is used to control the resolution behavior of Rspack. + + +
+ +[server?](./rspeedy.config.server.md) + + + + + + + +[Server](./rspeedy.server.md) \| undefined + + + + +_(Optional)_ The [Server](./rspeedy.server.md) option changes the behavior of dev-server. + + +
+ +[source?](./rspeedy.config.source.md) + + + + + + + +[Source](./rspeedy.source.md) \| undefined + + + + +_(Optional)_ The [Source](./rspeedy.source.md) option changes the behavior of source files. + + +
+ +[tools?](./rspeedy.config.tools.md) + + + + + + + +[Tools](./rspeedy.tools.md) \| undefined + + + + +_(Optional)_ The [Tools](./rspeedy.tools.md) options changes the behavior of various building tools. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.configparams.md b/docs/en/api/rspeedy/rspeedy.configparams.md index 424206287..44a4864d1 100644 --- a/docs/en/api/rspeedy/rspeedy.configparams.md +++ b/docs/en/api/rspeedy/rspeedy.configparams.md @@ -14,8 +14,64 @@ export interface ConfigParams ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [command](./rspeedy.configparams.command.md) | | 'build' \| 'dev' \| 'inspect' \| 'preview' \| (string & Record<never, never>) | The CLI command of Rspeedy. | -| [env](./rspeedy.configparams.env.md) | | 'production' \| 'development' \| 'test' \| (string & Record<never, never>) | The value of process.env['NODE_ENV'] | + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[command](./rspeedy.configparams.command.md) + + + + + + + +'build' \| 'dev' \| 'inspect' \| 'preview' \| (string & Record<never, never>) + + + + +The CLI command of Rspeedy. + + +
+ +[env](./rspeedy.configparams.env.md) + + + + + + + +'production' \| 'development' \| 'test' \| (string & Record<never, never>) + + + + +The value of `process.env['NODE_ENV']` + + +
diff --git a/docs/en/api/rspeedy/rspeedy.createrspeedy.md b/docs/en/api/rspeedy/rspeedy.createrspeedy.md index a67096af2..3b9941624 100644 --- a/docs/en/api/rspeedy/rspeedy.createrspeedy.md +++ b/docs/en/api/rspeedy/rspeedy.createrspeedy.md @@ -9,14 +9,56 @@ The `createRspeedy` method can let you create a Rspeedy instance and you can cus **Signature:** ```typescript -export declare function createRspeedy({ cwd, rspeedyConfig, loadEnv, environment, callerName, }: CreateRspeedyOptions): Promise; +export declare function createRspeedy(input: CreateRspeedyOptions): Promise; ``` ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| { cwd, rspeedyConfig, loadEnv, environment, callerName, } | [CreateRspeedyOptions](./rspeedy.createrspeedyoptions.md) | | + + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +{ cwd, rspeedyConfig, loadEnv, environment, callerName, } + + + + +(not declared) + + + + + +
+ +input + + + + +[CreateRspeedyOptions](./rspeedy.createrspeedyoptions.md) + + + + + +
**Returns:** diff --git a/docs/en/api/rspeedy/rspeedy.createrspeedyoptions.callername.md b/docs/en/api/rspeedy/rspeedy.createrspeedyoptions.callername.md index 8d3ab00e5..6b63e2575 100644 --- a/docs/en/api/rspeedy/rspeedy.createrspeedyoptions.callername.md +++ b/docs/en/api/rspeedy/rspeedy.createrspeedyoptions.callername.md @@ -12,6 +12,10 @@ The name of the framework or tool that is currently invoking Rsbuild. This allow callerName?: string; ``` +## Default Value + +'rspeedy' + ## Example Rsbuild plugins can access this value via `api.context.callerName`. diff --git a/docs/en/api/rspeedy/rspeedy.createrspeedyoptions.environment.md b/docs/en/api/rspeedy/rspeedy.createrspeedyoptions.environment.md index 48794956a..a35e56fd9 100644 --- a/docs/en/api/rspeedy/rspeedy.createrspeedyoptions.environment.md +++ b/docs/en/api/rspeedy/rspeedy.createrspeedyoptions.environment.md @@ -11,3 +11,8 @@ Only build specified environments. For example, passing `['lynx']` will only bui ```typescript environment?: CreateRsbuildOptions['environment']; ``` + +## Default Value + +\[\] + diff --git a/docs/en/api/rspeedy/rspeedy.createrspeedyoptions.loadenv.md b/docs/en/api/rspeedy/rspeedy.createrspeedyoptions.loadenv.md index e324196cc..46f57f398 100644 --- a/docs/en/api/rspeedy/rspeedy.createrspeedyoptions.loadenv.md +++ b/docs/en/api/rspeedy/rspeedy.createrspeedyoptions.loadenv.md @@ -11,3 +11,8 @@ Rspeedy automatically loads the .env file by default, utilizing the \[Rsbuild AP ```typescript loadEnv?: CreateRsbuildOptions['loadEnv']; ``` + +## Default Value + +true + diff --git a/docs/en/api/rspeedy/rspeedy.createrspeedyoptions.md b/docs/en/api/rspeedy/rspeedy.createrspeedyoptions.md index e6b53be27..5260bccd4 100644 --- a/docs/en/api/rspeedy/rspeedy.createrspeedyoptions.md +++ b/docs/en/api/rspeedy/rspeedy.createrspeedyoptions.md @@ -14,11 +14,121 @@ export interface CreateRspeedyOptions ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [callerName?](./rspeedy.createrspeedyoptions.callername.md) | | string | _(Optional)_ The name of the framework or tool that is currently invoking Rsbuild. This allows plugins to tailor their behavior based on the calling context. | -| [cwd?](./rspeedy.createrspeedyoptions.cwd.md) | | string | _(Optional)_ The root path of the current build. | -| [environment?](./rspeedy.createrspeedyoptions.environment.md) | | CreateRsbuildOptions\['environment'\] | _(Optional)_ Only build specified environments. For example, passing ['lynx'] will only build the lynx environment. If not specified or passing an empty array, all environments will be built. | -| [loadEnv?](./rspeedy.createrspeedyoptions.loadenv.md) | | CreateRsbuildOptions\['loadEnv'\] | _(Optional)_ Rspeedy automatically loads the .env file by default, utilizing the \[Rsbuild API\](https://rsbuild.dev/api/javascript-api/core\#load-env-variables). 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. | -| [rspeedyConfig?](./rspeedy.createrspeedyoptions.rspeedyconfig.md) | | [Config](./rspeedy.config.md) | _(Optional)_ The config of Rspeedy. | + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[callerName?](./rspeedy.createrspeedyoptions.callername.md) + + + + + + + +string + + + + +_(Optional)_ The name of the framework or tool that is currently invoking Rsbuild. This allows plugins to tailor their behavior based on the calling context. + + +
+ +[cwd?](./rspeedy.createrspeedyoptions.cwd.md) + + + + + + + +string + + + + +_(Optional)_ The root path of the current build. + + +
+ +[environment?](./rspeedy.createrspeedyoptions.environment.md) + + + + + + + +CreateRsbuildOptions\['environment'\] + + + + +_(Optional)_ Only build specified environments. For example, passing `['lynx']` will only build the `lynx` environment. If not specified or passing an empty array, all environments will be built. + + +
+ +[loadEnv?](./rspeedy.createrspeedyoptions.loadenv.md) + + + + + + + +CreateRsbuildOptions\['loadEnv'\] + + + + +_(Optional)_ Rspeedy automatically loads the .env file by default, utilizing the \[Rsbuild API\](https://rsbuild.dev/api/javascript-api/core\#load-env-variables). 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`. + + +
+ +[rspeedyConfig?](./rspeedy.createrspeedyoptions.rspeedyconfig.md) + + + + + + + +[Config](./rspeedy.config.md) + + + + +_(Optional)_ The config of Rspeedy. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.cssextract.md b/docs/en/api/rspeedy/rspeedy.cssextract.md index 599b9c94a..549e8102b 100644 --- a/docs/en/api/rspeedy/rspeedy.cssextract.md +++ b/docs/en/api/rspeedy/rspeedy.cssextract.md @@ -9,13 +9,68 @@ The [CssExtract](./rspeedy.cssextract.md) controls the options of [CssExtractRsp **Signature:** ```typescript -export interface CssExtract +export interface CssExtract ``` ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [loaderOptions?](./rspeedy.cssextract.loaderoptions.md) | | [CssExtractRspackLoaderOptions](./rspeedy.cssextractrspackloaderoptions.md) \| undefined | _(Optional)_ The options of CSS extract loader. | -| [pluginOptions?](./rspeedy.cssextract.pluginoptions.md) | | [CssExtractRspackPluginOptions](./rspeedy.cssextractrspackpluginoptions.md) \| undefined | _(Optional)_ The options for [CssExtractRspackPlugin](https://rspack.dev/plugins/rspack/css-extract-rspack-plugin) | + + + +
+Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[loaderOptions?](./rspeedy.cssextract.loaderoptions.md) + + + + + + + +[CssExtractRspackLoaderOptions](./rspeedy.cssextractrspackloaderoptions.md) \| undefined + + + + +_(Optional)_ The options of CSS extract loader. + + +
+ +[pluginOptions?](./rspeedy.cssextract.pluginoptions.md) + + + + + + + +[CssExtractRspackPluginOptions](./rspeedy.cssextractrspackpluginoptions.md) \| undefined + + + + +_(Optional)_ The options for [CssExtractRspackPlugin](https://rspack.dev/plugins/rspack/css-extract-rspack-plugin) + + +
diff --git a/docs/en/api/rspeedy/rspeedy.cssextractrspackloaderoptions.md b/docs/en/api/rspeedy/rspeedy.cssextractrspackloaderoptions.md index 6b6c081f5..707240e60 100644 --- a/docs/en/api/rspeedy/rspeedy.cssextractrspackloaderoptions.md +++ b/docs/en/api/rspeedy/rspeedy.cssextractrspackloaderoptions.md @@ -14,7 +14,45 @@ export interface CssExtractRspackLoaderOptions ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [esModule?](./rspeedy.cssextractrspackloaderoptions.esmodule.md) | | boolean \| undefined | _(Optional)_ The same as [https://github.com/webpack-contrib/mini-css-extract-plugin\#esModule](https://github.com/webpack-contrib/mini-css-extract-plugin#esModule). By default, @lynx-js/css-extract-webpack-plugin generates JS modules that use the ES modules syntax. There are some cases in which using ES modules is beneficial, like in the case of module concatenation and tree shaking. | + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[esModule?](./rspeedy.cssextractrspackloaderoptions.esmodule.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ The same as [https://github.com/webpack-contrib/mini-css-extract-plugin\#esModule](https://github.com/webpack-contrib/mini-css-extract-plugin#esModule). By default, `@lynx-js/css-extract-webpack-plugin` generates JS modules that use the ES modules syntax. There are some cases in which using ES modules is beneficial, like in the case of module concatenation and tree shaking. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.cssextractrspackpluginoptions.md b/docs/en/api/rspeedy/rspeedy.cssextractrspackpluginoptions.md index 458744cb9..829470235 100644 --- a/docs/en/api/rspeedy/rspeedy.cssextractrspackpluginoptions.md +++ b/docs/en/api/rspeedy/rspeedy.cssextractrspackpluginoptions.md @@ -9,13 +9,68 @@ The options for [CssExtractRspackPlugin](https://rspack.dev/plugins/rspack/css-e **Signature:** ```typescript -export interface CssExtractRspackPluginOptions +export interface CssExtractRspackPluginOptions ``` ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [ignoreOrder?](./rspeedy.cssextractrspackpluginoptions.ignoreorder.md) | | boolean \| undefined | _(Optional)_ | -| [pathinfo?](./rspeedy.cssextractrspackpluginoptions.pathinfo.md) | | boolean \| undefined | _(Optional)_ | + + + +
+Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[ignoreOrder?](./rspeedy.cssextractrspackpluginoptions.ignoreorder.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ + + +
+ +[pathinfo?](./rspeedy.cssextractrspackpluginoptions.pathinfo.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ + + +
diff --git a/docs/en/api/rspeedy/rspeedy.cssloader.md b/docs/en/api/rspeedy/rspeedy.cssloader.md index 33b28588a..46be3e5de 100644 --- a/docs/en/api/rspeedy/rspeedy.cssloader.md +++ b/docs/en/api/rspeedy/rspeedy.cssloader.md @@ -32,8 +32,64 @@ const defaultOptions = { ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [importLoaders?](./rspeedy.cssloader.importloaders.md) | | 0 \| 1 \| 2 \| undefined | _(Optional)_ The option importLoaders allows you to configure how many loaders before css-loader should be applied to @imported resources and CSS modules imports. | -| [modules?](./rspeedy.cssloader.modules.md) | | boolean \| [CssLoaderModules](./rspeedy.cssloadermodules.md) \| undefined | _(Optional)_ The [cssLoader.modules](./rspeedy.cssloadermodules.md) option enables/disables the CSS Modules specification and setup basic behavior. | + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[importLoaders?](./rspeedy.cssloader.importloaders.md) + + + + + + + +0 \| 1 \| 2 \| undefined + + + + +_(Optional)_ The option `importLoaders` allows you to configure how many loaders before `css-loader` should be applied to `@imported` resources and CSS modules imports. + + +
+ +[modules?](./rspeedy.cssloader.modules.md) + + + + + + + +boolean \| [CssLoaderModules](./rspeedy.cssloadermodules.md) \| undefined + + + + +_(Optional)_ The [cssLoader.modules](./rspeedy.cssloadermodules.md) option enables/disables the CSS Modules specification and setup basic behavior. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.cssloadermodules.md b/docs/en/api/rspeedy/rspeedy.cssloadermodules.md index c5aab912e..8593b317a 100644 --- a/docs/en/api/rspeedy/rspeedy.cssloadermodules.md +++ b/docs/en/api/rspeedy/rspeedy.cssloadermodules.md @@ -14,10 +14,102 @@ export interface CssLoaderModules ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [auto?](./rspeedy.cssloadermodules.auto.md) | | boolean \| RegExp \| ((filename: string) => boolean) \| undefined | _(Optional)_ The auto option allows CSS modules to be automatically enabled based on their filenames. | -| [exportLocalsConvention?](./rspeedy.cssloadermodules.exportlocalsconvention.md) | | [CssModuleLocalsConvention](./rspeedy.cssmodulelocalsconvention.md) \| undefined | _(Optional)_ The style of exported class names. | -| [localIdentName?](./rspeedy.cssloadermodules.localidentname.md) | | string \| undefined | _(Optional)_ Sets the format of the className generated by CSS Modules after compilation. | -| [namedExport?](./rspeedy.cssloadermodules.namedexport.md) | | boolean \| undefined | _(Optional)_ Enables/disables ES modules named export for locals. | + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[auto?](./rspeedy.cssloadermodules.auto.md) + + + + + + + +boolean \| RegExp \| ((filename: string) => boolean) \| undefined + + + + +_(Optional)_ The `auto` option allows CSS modules to be automatically enabled based on their filenames. + + +
+ +[exportLocalsConvention?](./rspeedy.cssloadermodules.exportlocalsconvention.md) + + + + + + + +[CssModuleLocalsConvention](./rspeedy.cssmodulelocalsconvention.md) \| undefined + + + + +_(Optional)_ The style of exported class names. + + +
+ +[localIdentName?](./rspeedy.cssloadermodules.localidentname.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ Sets the format of the className generated by CSS Modules after compilation. + + +
+ +[namedExport?](./rspeedy.cssloadermodules.namedexport.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ Enables/disables ES modules named export for locals. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.cssmodules.md b/docs/en/api/rspeedy/rspeedy.cssmodules.md index 462a0517e..b63d7c3a9 100644 --- a/docs/en/api/rspeedy/rspeedy.cssmodules.md +++ b/docs/en/api/rspeedy/rspeedy.cssmodules.md @@ -18,10 +18,102 @@ The CSS module is enabled for `*.module.css`, `*.module.scss` and `*.mod ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [auto?](./rspeedy.cssmodules.auto.md) | | boolean \| RegExp \| ((filename: string) => boolean) \| undefined | _(Optional)_ The auto option allows CSS modules to be automatically enabled based on their filenames. | -| [exportGlobals?](./rspeedy.cssmodules.exportglobals.md) | | boolean \| undefined | _(Optional)_ Allows exporting names from global class names, so you can use them via import. | -| [exportLocalsConvention?](./rspeedy.cssmodules.exportlocalsconvention.md) | | [CssModuleLocalsConvention](./rspeedy.cssmodulelocalsconvention.md) \| undefined | _(Optional)_ The style of exported class names. | -| [localIdentName?](./rspeedy.cssmodules.localidentname.md) | | string \| undefined | _(Optional)_ Sets the format of the className generated by CSS Modules after compilation. | + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[auto?](./rspeedy.cssmodules.auto.md) + + + + + + + +boolean \| RegExp \| ((filename: string) => boolean) \| undefined + + + + +_(Optional)_ The `auto` option allows CSS modules to be automatically enabled based on their filenames. + + +
+ +[exportGlobals?](./rspeedy.cssmodules.exportglobals.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ Allows exporting names from global class names, so you can use them via import. + + +
+ +[exportLocalsConvention?](./rspeedy.cssmodules.exportlocalsconvention.md) + + + + + + + +[CssModuleLocalsConvention](./rspeedy.cssmodulelocalsconvention.md) \| undefined + + + + +_(Optional)_ The style of exported class names. + + +
+ +[localIdentName?](./rspeedy.cssmodules.localidentname.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ Sets the format of the className generated by CSS Modules after compilation. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.decorators.md b/docs/en/api/rspeedy/rspeedy.decorators.md index 9ad516c89..f908b1c75 100644 --- a/docs/en/api/rspeedy/rspeedy.decorators.md +++ b/docs/en/api/rspeedy/rspeedy.decorators.md @@ -18,7 +18,45 @@ See [Decorators.version](./rspeedy.decorators.version.md) for more information. ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [version?](./rspeedy.decorators.version.md) | | 'legacy' \| '2022-03' | _(Optional)_ Specify the decorator syntax version to be used. | + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[version?](./rspeedy.decorators.version.md) + + + + + + + +'legacy' \| '2022-03' + + + + +_(Optional)_ Specify the decorator syntax version to be used. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.defineconfig.md b/docs/en/api/rspeedy/rspeedy.defineconfig.md index 179c4607e..7069d55ce 100644 --- a/docs/en/api/rspeedy/rspeedy.defineconfig.md +++ b/docs/en/api/rspeedy/rspeedy.defineconfig.md @@ -14,9 +14,39 @@ export declare function defineConfig(config: Config): Config; ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| config | [Config](./rspeedy.config.md) | The config of Rspeedy. | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +config + + + + +[Config](./rspeedy.config.md) + + + + +The config of Rspeedy. + + +
**Returns:** diff --git a/docs/en/api/rspeedy/rspeedy.defineconfig_1.md b/docs/en/api/rspeedy/rspeedy.defineconfig_1.md index 779f8471e..4cd819e70 100644 --- a/docs/en/api/rspeedy/rspeedy.defineconfig_1.md +++ b/docs/en/api/rspeedy/rspeedy.defineconfig_1.md @@ -14,9 +14,39 @@ export declare function defineConfig(config: (params: ConfigParams) => Config): ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| config | (params: [ConfigParams](./rspeedy.configparams.md)) => [Config](./rspeedy.config.md) | The function that returns a config of Rspeedy. | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +config + + + + +(params: [ConfigParams](./rspeedy.configparams.md)) => [Config](./rspeedy.config.md) + + + + +The function that returns a config of Rspeedy. + + +
**Returns:** diff --git a/docs/en/api/rspeedy/rspeedy.defineconfig_2.md b/docs/en/api/rspeedy/rspeedy.defineconfig_2.md index 27f5139ed..6c4152fb9 100644 --- a/docs/en/api/rspeedy/rspeedy.defineconfig_2.md +++ b/docs/en/api/rspeedy/rspeedy.defineconfig_2.md @@ -14,9 +14,39 @@ export declare function defineConfig(config: Promise): Promise; ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| config | Promise<[Config](./rspeedy.config.md)> | The promise that resolves to a config of Rspeedy. | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +config + + + + +Promise<[Config](./rspeedy.config.md)> + + + + +The promise that resolves to a config of Rspeedy. + + +
**Returns:** diff --git a/docs/en/api/rspeedy/rspeedy.defineconfig_3.md b/docs/en/api/rspeedy/rspeedy.defineconfig_3.md index cffeca674..79e1df54b 100644 --- a/docs/en/api/rspeedy/rspeedy.defineconfig_3.md +++ b/docs/en/api/rspeedy/rspeedy.defineconfig_3.md @@ -14,9 +14,39 @@ export declare function defineConfig(config: (params: ConfigParams) => Promise) => Promise<[Config](./rspeedy.config.md)> | The function that returns a promise that resolves to a config of Rspeedy. | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +config + + + + +(params: [ConfigParams](./rspeedy.configparams.md)) => Promise<[Config](./rspeedy.config.md)> + + + + +The function that returns a promise that resolves to a config of Rspeedy. + + +
**Returns:** diff --git a/docs/en/api/rspeedy/rspeedy.dev.md b/docs/en/api/rspeedy/rspeedy.dev.md index 25e228973..aaed79bc6 100644 --- a/docs/en/api/rspeedy/rspeedy.dev.md +++ b/docs/en/api/rspeedy/rspeedy.dev.md @@ -14,13 +14,167 @@ export interface Dev ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [assetPrefix?](./rspeedy.dev.assetprefix.md) | | string \| boolean \| undefined | _(Optional)_ The [Dev.assetPrefix](./rspeedy.dev.assetprefix.md) is used to set the URL prefix for static assets during development. | -| [client?](./rspeedy.dev.client.md) | | [Client](./rspeedy.devclient.md) \| undefined | _(Optional)_ Configuration of the development client. | -| [hmr?](./rspeedy.dev.hmr.md) | | boolean \| undefined | _(Optional)_ Whether to enable Hot Module Replacement (HMR). | -| [liveReload?](./rspeedy.dev.livereload.md) | | boolean \| undefined |

_(Optional)_ Whether to enable live reload functionality.

Defaults to true.

Live reload is used as a fallback when [Dev.hmr](./rspeedy.dev.hmr.md) is disabled or cannot be used in certain scenarios. When enabled, the page will automatically refresh when source files are changed.

To completely disable both HMR and live reload, set both dev.hmr and dev.liveReload to false. Then, no WebSocket requests will be made to the dev server on the page, and the page will not automatically refresh when file changes.

| -| [progressBar?](./rspeedy.dev.progressbar.md) | | boolean \| { id?: string; } \| undefined |

_(Optional)_ Whether to display progress bar during compilation.

Defaults to true.

| -| [watchFiles?](./rspeedy.dev.watchfiles.md) | | WatchFiles \| WatchFiles\[\] \| undefined | _(Optional)_ Watch specified files and directories for changes. When a file change is detected, it can trigger a page reload or restart the dev server. | -| [writeToDisk?](./rspeedy.dev.writetodisk.md) | | boolean \| ((filename: string) => boolean) \| undefined | _(Optional)_ Used to control whether the build artifacts of the development environment are written to the disk. | + + + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[assetPrefix?](./rspeedy.dev.assetprefix.md) + + + + + + + +string \| boolean \| undefined + + + + +_(Optional)_ The [Dev.assetPrefix](./rspeedy.dev.assetprefix.md) is used to set the URL prefix for static assets during development. + + +
+ +[client?](./rspeedy.dev.client.md) + + + + + + + +[Client](./rspeedy.devclient.md) \| undefined + + + + +_(Optional)_ Configuration of the development client. + + +
+ +[hmr?](./rspeedy.dev.hmr.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ Whether to enable Hot Module Replacement (HMR). + + +
+ +[liveReload?](./rspeedy.dev.livereload.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ Whether to enable live reload functionality. + +Defaults to `true`. + +Live reload is used as a fallback when [Dev.hmr](./rspeedy.dev.hmr.md) is disabled or cannot be used in certain scenarios. When enabled, the page will automatically refresh when source files are changed. + +To completely disable both HMR and live reload, set both `dev.hmr` and `dev.liveReload` to `false`. Then, no WebSocket requests will be made to the dev server on the page, and the page will not automatically refresh when file changes. + + +
+ +[progressBar?](./rspeedy.dev.progressbar.md) + + + + + + + +boolean \| { id?: string; } \| undefined + + + + +_(Optional)_ Whether to display progress bar during compilation. + +Defaults to `true`. + + +
+ +[watchFiles?](./rspeedy.dev.watchfiles.md) + + + + + + + +WatchFiles \| WatchFiles\[\] \| undefined + + + + +_(Optional)_ Watch specified files and directories for changes. When a file change is detected, it can trigger a page reload or restart the dev server. + + +
+ +[writeToDisk?](./rspeedy.dev.writetodisk.md) + + + + + + + +boolean \| ((filename: string) => boolean) \| undefined + + + + +_(Optional)_ Used to control whether the build artifacts of the development environment are written to the disk. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.devclient.md b/docs/en/api/rspeedy/rspeedy.devclient.md index 8752fff33..320acf254 100644 --- a/docs/en/api/rspeedy/rspeedy.devclient.md +++ b/docs/en/api/rspeedy/rspeedy.devclient.md @@ -14,7 +14,45 @@ export interface Client ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [websocketTransport?](./rspeedy.devclient.websockettransport.md) | | string \| undefined | _(Optional)_ The path to websocket. | + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[websocketTransport?](./rspeedy.devclient.websockettransport.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ The path to websocket. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.distpath.md b/docs/en/api/rspeedy/rspeedy.distpath.md index de5f7a9e6..c54b9df05 100644 --- a/docs/en/api/rspeedy/rspeedy.distpath.md +++ b/docs/en/api/rspeedy/rspeedy.distpath.md @@ -19,7 +19,45 @@ More options can be found at [Rsbuild - distPath](https://rsbuild.dev/config/out ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [intermediate?](./rspeedy.distpath.intermediate.md) | | string \| undefined | _(Optional)_ The output directory of the intermediate files. | + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[intermediate?](./rspeedy.distpath.intermediate.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ The output directory of the intermediate files. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.entrydescription.import.md b/docs/en/api/rspeedy/rspeedy.entrydescription.import.md index 7aa4f082e..a9d69b0db 100644 --- a/docs/en/api/rspeedy/rspeedy.entrydescription.import.md +++ b/docs/en/api/rspeedy/rspeedy.entrydescription.import.md @@ -12,6 +12,10 @@ The path to the entry module(s). import?: string | string[] | undefined; ``` +## Default Value + +`'./src/index.js'` + ## Remarks If no value is provided, the default value `src/index.js` will be used. diff --git a/docs/en/api/rspeedy/rspeedy.entrydescription.md b/docs/en/api/rspeedy/rspeedy.entrydescription.md index 1ad3b5162..98b54f191 100644 --- a/docs/en/api/rspeedy/rspeedy.entrydescription.md +++ b/docs/en/api/rspeedy/rspeedy.entrydescription.md @@ -18,8 +18,64 @@ It is similar with the [Entry Description Object](https://www.rspack.dev/config/ ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [import?](./rspeedy.entrydescription.import.md) | | string \| string\[\] \| undefined | _(Optional)_ The path to the entry module(s). | -| [publicPath?](./rspeedy.entrydescription.publicpath.md) | | string \| undefined | _(Optional)_ 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. | + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[import?](./rspeedy.entrydescription.import.md) + + + + + + + +string \| string\[\] \| undefined + + + + +_(Optional)_ The path to the entry module(s). + + +
+ +[publicPath?](./rspeedy.entrydescription.publicpath.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ 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. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.exposedapi.md b/docs/en/api/rspeedy/rspeedy.exposedapi.md index f23613235..ae0a8c938 100644 --- a/docs/en/api/rspeedy/rspeedy.exposedapi.md +++ b/docs/en/api/rspeedy/rspeedy.exposedapi.md @@ -28,11 +28,121 @@ const RsbuildPlugin = { ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [config](./rspeedy.exposedapi.config.md) | | [Config](./rspeedy.config.md) | The user config. | -| [debug](./rspeedy.exposedapi.debug.md) | | (message: string \| (() => string)) => void | Print debug logs. | -| [exit](./rspeedy.exposedapi.exit.md) | | (code?: number) => Promise<void> \| void | Exit the process. | -| [logger](./rspeedy.exposedapi.logger.md) | | typeof logger | Get the Rspeedy logger. | -| [version](./rspeedy.exposedapi.version.md) | | string | The version of Rspeedy. | + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[config](./rspeedy.exposedapi.config.md) + + + + + + + +[Config](./rspeedy.config.md) + + + + +The user config. + + +
+ +[debug](./rspeedy.exposedapi.debug.md) + + + + + + + +(message: string \| (() => string)) => void + + + + +Print debug logs. + + +
+ +[exit](./rspeedy.exposedapi.exit.md) + + + + + + + +(code?: number) => Promise<void> \| void + + + + +Exit the process. + + +
+ +[logger](./rspeedy.exposedapi.logger.md) + + + + + + + +typeof logger + + + + +Get the Rspeedy logger. + + +
+ +[version](./rspeedy.exposedapi.version.md) + + + + + + + +string + + + + +The version of Rspeedy. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.filename.md b/docs/en/api/rspeedy/rspeedy.filename.md index 8690899da..49dd4ff55 100644 --- a/docs/en/api/rspeedy/rspeedy.filename.md +++ b/docs/en/api/rspeedy/rspeedy.filename.md @@ -18,16 +18,216 @@ If a string is provided, it will be used as [Filename.bundle](./rspeedy.filename ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [assets?](./rspeedy.filename.assets.md) | | Rspack.AssetModuleFilename | _(Optional)_ The name of other assets, except for above (image, svg, font, html, wasm...) | -| [bundle?](./rspeedy.filename.bundle.md) | | string \| undefined | _(Optional)_ The name of the bundle files. | -| [css?](./rspeedy.filename.css.md) | | Rspack.CssFilename \| undefined | _(Optional)_ The name of the CSS files. | -| [font?](./rspeedy.filename.font.md) | | Rspack.AssetModuleFilename \| undefined | _(Optional)_ The name of the font files. | -| [image?](./rspeedy.filename.image.md) | | Rspack.AssetModuleFilename \| undefined | _(Optional)_ The name of non-SVG images. | -| [js?](./rspeedy.filename.js.md) | | Rspack.Filename \| undefined | _(Optional)_ The name of the JavaScript files. | -| [media?](./rspeedy.filename.media.md) | | Rspack.AssetModuleFilename \| undefined | _(Optional)_ The name of media assets, such as video. | -| [svg?](./rspeedy.filename.svg.md) | | Rspack.AssetModuleFilename \| undefined | _(Optional)_ The name of the SVG images. | -| [template?](./rspeedy.filename.template.md) | | string \| undefined | _(Optional)_ The name of the template files. | -| [wasm?](./rspeedy.filename.wasm.md) | | Rspack.WebassemblyModuleFilename | _(Optional)_ The name of WebAssembly files. | + + + + + + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[assets?](./rspeedy.filename.assets.md) + + + + + + + +Rspack.AssetModuleFilename + + + + +_(Optional)_ The name of other assets, except for above (image, svg, font, html, wasm...) + + +
+ +[bundle?](./rspeedy.filename.bundle.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ The name of the bundle files. + + +
+ +[css?](./rspeedy.filename.css.md) + + + + + + + +Rspack.CssFilename \| undefined + + + + +_(Optional)_ The name of the CSS files. + + +
+ +[font?](./rspeedy.filename.font.md) + + + + + + + +Rspack.AssetModuleFilename \| undefined + + + + +_(Optional)_ The name of the font files. + + +
+ +[image?](./rspeedy.filename.image.md) + + + + + + + +Rspack.AssetModuleFilename \| undefined + + + + +_(Optional)_ The name of non-SVG images. + + +
+ +[js?](./rspeedy.filename.js.md) + + + + + + + +Rspack.Filename \| undefined + + + + +_(Optional)_ The name of the JavaScript files. + + +
+ +[media?](./rspeedy.filename.media.md) + + + + + + + +Rspack.AssetModuleFilename \| undefined + + + + +_(Optional)_ The name of media assets, such as video. + + +
+ +[svg?](./rspeedy.filename.svg.md) + + + + + + + +Rspack.AssetModuleFilename \| undefined + + + + +_(Optional)_ The name of the SVG images. + + +
+ +[template?](./rspeedy.filename.template.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ The name of the template files. + + +
+ +[wasm?](./rspeedy.filename.wasm.md) + + + + + + + +Rspack.WebassemblyModuleFilename + + + + +_(Optional)_ The name of WebAssembly files. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.loadconfig.md b/docs/en/api/rspeedy/rspeedy.loadconfig.md index 09861271c..44dce5dd0 100644 --- a/docs/en/api/rspeedy/rspeedy.loadconfig.md +++ b/docs/en/api/rspeedy/rspeedy.loadconfig.md @@ -14,9 +14,39 @@ export declare function loadConfig(loadConfigOptions: LoadConfigOptions): Promis ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| loadConfigOptions | [LoadConfigOptions](./rspeedy.loadconfigoptions.md) | the options of loadConfig method. | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +loadConfigOptions + + + + +[LoadConfigOptions](./rspeedy.loadconfigoptions.md) + + + + +the options of `loadConfig` method. + + +
**Returns:** diff --git a/docs/en/api/rspeedy/rspeedy.loadconfigoptions.md b/docs/en/api/rspeedy/rspeedy.loadconfigoptions.md index 388362b5e..ecf7ff2f3 100644 --- a/docs/en/api/rspeedy/rspeedy.loadconfigoptions.md +++ b/docs/en/api/rspeedy/rspeedy.loadconfigoptions.md @@ -14,8 +14,64 @@ export interface LoadConfigOptions ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [configPath?](./rspeedy.loadconfigoptions.configpath.md) | | string \| undefined | _(Optional)_ | -| [cwd?](./rspeedy.loadconfigoptions.cwd.md) | | string \| undefined | _(Optional)_ | + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[configPath?](./rspeedy.loadconfigoptions.configpath.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ + + +
+ +[cwd?](./rspeedy.loadconfigoptions.cwd.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ + + +
diff --git a/docs/en/api/rspeedy/rspeedy.loadconfigresult.md b/docs/en/api/rspeedy/rspeedy.loadconfigresult.md index 9ea620f9d..779617991 100644 --- a/docs/en/api/rspeedy/rspeedy.loadconfigresult.md +++ b/docs/en/api/rspeedy/rspeedy.loadconfigresult.md @@ -14,8 +14,64 @@ export interface LoadConfigResult ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [configPath](./rspeedy.loadconfigresult.configpath.md) | | string | The configuration path that has been loaded. | -| [content](./rspeedy.loadconfigresult.content.md) | | [Config](./rspeedy.config.md) | The configuration object that exported from the configuration file. | + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[configPath](./rspeedy.loadconfigresult.configpath.md) + + + + + + + +string + + + + +The configuration path that has been loaded. + + +
+ +[content](./rspeedy.loadconfigresult.content.md) + + + + + + + +[Config](./rspeedy.config.md) + + + + +The configuration object that exported from the configuration file. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.md b/docs/en/api/rspeedy/rspeedy.md index 0529e674a..c7bba5257 100644 --- a/docs/en/api/rspeedy/rspeedy.md +++ b/docs/en/api/rspeedy/rspeedy.md @@ -8,7 +8,7 @@ The document contains all the configurations of the `@lynx-js/rspeedy` package. ## Example -Use `lynx.config.ts` with [defineConfig()](./rspeedy.defineconfig.md) to get better TypeScript intellisense. +Use `lynx.config.ts` with to get better TypeScript intellisense. ```ts import { defineConfig } from '@lynx-js/rspeedy' @@ -19,66 +19,551 @@ export default defineConfig({ ## Functions -| Function | Description | -| --- | --- | -| [createRspeedy({ cwd, rspeedyConfig, loadEnv, environment, callerName, })](./rspeedy.createrspeedy.md) | The createRspeedy method can let you create a Rspeedy instance and you can customize the build or development process in Node.js Runtime. | -| [defineConfig(config)](./rspeedy.defineconfig.md) | The defineConfig method is a helper function used to get TypeScript intellisense. | -| [defineConfig(config)](./rspeedy.defineconfig_1.md) | The defineConfig method is a helper function used to get TypeScript intellisense. | -| [defineConfig(config)](./rspeedy.defineconfig_2.md) | The defineConfig method is a helper function used to get TypeScript intellisense. | -| [defineConfig(config)](./rspeedy.defineconfig_3.md) | The defineConfig method is a helper function used to get TypeScript intellisense. | -| [loadConfig(loadConfigOptions)](./rspeedy.loadconfig.md) | Load the build config by the config path. | -| [mergeRspeedyConfig(configs)](./rspeedy.mergerspeedyconfig.md) | Merge multiple Rspeedy configuration objects. | + + + + + + + + +
+ +Function + + + + +Description + + +
+ +[createRspeedy({ cwd, rspeedyConfig, loadEnv, environment, callerName, }, input)](./rspeedy.createrspeedy.md) + + + + +The `createRspeedy` method can let you create a Rspeedy instance and you can customize the build or development process in Node.js Runtime. + + +
+ +[defineConfig(config)](./rspeedy.defineconfig.md) + + + + +The `defineConfig` method is a helper function used to get TypeScript intellisense. + + +
+ +[defineConfig(config)](./rspeedy.defineconfig_1.md) + + + + +The `defineConfig` method is a helper function used to get TypeScript intellisense. + + +
+ +[defineConfig(config)](./rspeedy.defineconfig_2.md) + + + + +The `defineConfig` method is a helper function used to get TypeScript intellisense. + + +
+ +[defineConfig(config)](./rspeedy.defineconfig_3.md) + + + + +The `defineConfig` method is a helper function used to get TypeScript intellisense. + + +
+ +[loadConfig(loadConfigOptions)](./rspeedy.loadconfig.md) + + + + +Load the build config by the config path. + + +
+ +[mergeRspeedyConfig(configs)](./rspeedy.mergerspeedyconfig.md) + + + + +Merge multiple Rspeedy configuration objects. + + +
## Interfaces -| Interface | Description | -| --- | --- | -| [BuildCache](./rspeedy.buildcache.md) |

**_(BETA)_** Enable or configure persistent build cache.

This feature is experimental and may be changed in the future.

| -| [ChunkSplit](./rspeedy.chunksplit.md) | [Performance.chunkSplit](./rspeedy.performance.chunksplit.md) is used to configure the chunk splitting strategy. | -| [ChunkSplitBySize](./rspeedy.chunksplitbysize.md) | [Performance.chunkSplit](./rspeedy.performance.chunksplit.md) is used to configure the chunk splitting strategy. | -| [ChunkSplitCustom](./rspeedy.chunksplitcustom.md) | [Performance.chunkSplit](./rspeedy.performance.chunksplit.md) is used to configure the chunk splitting strategy. | -| [Config](./rspeedy.config.md) | The Config is the configuration that rspeedy uses. | -| [ConfigParams](./rspeedy.configparams.md) | Parameters for the function exported from lynx.config.js. | -| [CreateRspeedyOptions](./rspeedy.createrspeedyoptions.md) | The options of createRspeedy method. | -| [CssExtract](./rspeedy.cssextract.md) | The [CssExtract](./rspeedy.cssextract.md) controls the options of [CssExtractRspackPlugin](https://www.rspack.dev/plugins/rspack/css-extract-rspack-plugin) | -| [CssExtractRspackLoaderOptions](./rspeedy.cssextractrspackloaderoptions.md) | The options of CSS extract loader. | -| [CssExtractRspackPluginOptions](./rspeedy.cssextractrspackpluginoptions.md) | The options for [CssExtractRspackPlugin](https://rspack.dev/plugins/rspack/css-extract-rspack-plugin) | -| [CssLoader](./rspeedy.cssloader.md) | The [CssLoader](./rspeedy.cssloader.md) controls the options of [css-loader](https://github.com/webpack-contrib/css-loader). | -| [CssLoaderModules](./rspeedy.cssloadermodules.md) | The [cssLoader.modules](./rspeedy.cssloadermodules.md) option enables/disables the CSS Modules specification and setup basic behavior. | -| [CssModules](./rspeedy.cssmodules.md) | The [CssModules](./rspeedy.cssmodules.md) option is used for the customization of CSS Modules configurations. | -| [Decorators](./rspeedy.decorators.md) | Used to configure the decorators syntax. | -| [Dev](./rspeedy.dev.md) | The [Dev](./rspeedy.dev.md) option is used to control the behavior related with development. Including: HMR, DevServer, etc. | -| [DevClient](./rspeedy.devclient.md) | Configuration of the development client. | -| [DistPath](./rspeedy.distpath.md) | Set the directory of the dist files. | -| [EntryDescription](./rspeedy.entrydescription.md) | The EntryDescription describes a entry. It is useful when the project has multiple entries with different configuration. | -| [ExposedAPI](./rspeedy.exposedapi.md) | The exposed API of Rspeedy. Can be used in Rsbuild plugin with [api.useExposed](https://rsbuild.dev/plugins/dev/core#apiuseexposed). | -| [Filename](./rspeedy.filename.md) | The [Filename](./rspeedy.filename.md) determines the name of the JavaScript bundle file to be output. These bundles will be written to the directory specified by output.path. | -| [LoadConfigOptions](./rspeedy.loadconfigoptions.md) | The options of loadConfig. | -| [LoadConfigResult](./rspeedy.loadconfigresult.md) | The result of [loadConfig()](./rspeedy.loadconfig.md). | -| [Minify](./rspeedy.minify.md) | The [Minify](./rspeedy.minify.md) configures whether to enable code minification in the production build, or to configure minimizer options. | -| [Output](./rspeedy.output.md) | The [Output](./rspeedy.output.md) option is used to set how and where should the bundles and assets output. | -| [Performance](./rspeedy.performance.md) | The [Performance](./rspeedy.performance.md) option is used to optimize the build-time and runtime performance. | -| [Resolve](./rspeedy.resolve.md) | The [Resolve](./rspeedy.resolve.md) option is used to control the resolution behavior of Rspack. | -| [Server](./rspeedy.server.md) | The [Server](./rspeedy.server.md) option changes the behavior of dev-server. | -| [Source](./rspeedy.source.md) | The [Source](./rspeedy.source.md) option changes the behavior of source files. | -| [SourceMap](./rspeedy.sourcemap.md) | The [SourceMap](./rspeedy.sourcemap.md) configures whether and how to generate source-map for outputs. | -| [Tools](./rspeedy.tools.md) | The [Tools](./rspeedy.tools.md) options changes the behavior of various building tools. | -| [TransformImport](./rspeedy.transformimport.md) | The [TransformImport](./rspeedy.transformimport.md) option transforms the import paths to enable modular imports from subpaths of third-party packages, similar to the functionality provided by [babel-plugin-import](https://npmjs.com/package/babel-plugin-import). | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +Interface + + + + +Description + + +
+ +[BuildCache](./rspeedy.buildcache.md) + + + + +**_(BETA)_** Enable or configure persistent build cache. + +This feature is experimental and may be changed in the future. + + +
+ +[ChunkSplit](./rspeedy.chunksplit.md) + + + + +[Performance.chunkSplit](./rspeedy.performance.chunksplit.md) is used to configure the chunk splitting strategy. + + +
+ +[ChunkSplitBySize](./rspeedy.chunksplitbysize.md) + + + + +[Performance.chunkSplit](./rspeedy.performance.chunksplit.md) is used to configure the chunk splitting strategy. + + +
+ +[ChunkSplitCustom](./rspeedy.chunksplitcustom.md) + + + + +[Performance.chunkSplit](./rspeedy.performance.chunksplit.md) is used to configure the chunk splitting strategy. + + +
+ +[Config](./rspeedy.config.md) + + + + +The `Config` is the configuration that `rspeedy` uses. + + +
+ +[ConfigParams](./rspeedy.configparams.md) + + + + +Parameters for the function exported from `lynx.config.js`. + + +
+ +[CreateRspeedyOptions](./rspeedy.createrspeedyoptions.md) + + + + +The options of `createRspeedy` method. + + +
+ +[CssExtract](./rspeedy.cssextract.md) + + + + +The [CssExtract](./rspeedy.cssextract.md) controls the options of [CssExtractRspackPlugin](https://www.rspack.dev/plugins/rspack/css-extract-rspack-plugin) + + +
+ +[CssExtractRspackLoaderOptions](./rspeedy.cssextractrspackloaderoptions.md) + + + + +The options of CSS extract loader. + + +
+ +[CssExtractRspackPluginOptions](./rspeedy.cssextractrspackpluginoptions.md) + + + + +The options for [CssExtractRspackPlugin](https://rspack.dev/plugins/rspack/css-extract-rspack-plugin) + + +
+ +[CssLoader](./rspeedy.cssloader.md) + + + + +The [CssLoader](./rspeedy.cssloader.md) controls the options of [css-loader](https://github.com/webpack-contrib/css-loader). + + +
+ +[CssLoaderModules](./rspeedy.cssloadermodules.md) + + + + +The [cssLoader.modules](./rspeedy.cssloadermodules.md) option enables/disables the CSS Modules specification and setup basic behavior. + + +
+ +[CssModules](./rspeedy.cssmodules.md) + + + + +The [CssModules](./rspeedy.cssmodules.md) option is used for the customization of CSS Modules configurations. + + +
+ +[Decorators](./rspeedy.decorators.md) + + + + +Used to configure the decorators syntax. + + +
+ +[Dev](./rspeedy.dev.md) + + + + +The [Dev](./rspeedy.dev.md) option is used to control the behavior related with development. Including: HMR, DevServer, etc. + + +
+ +[DevClient](./rspeedy.devclient.md) + + + + +Configuration of the development client. + + +
+ +[DistPath](./rspeedy.distpath.md) + + + + +Set the directory of the dist files. + + +
+ +[EntryDescription](./rspeedy.entrydescription.md) + + + + +The `EntryDescription` describes a entry. It is useful when the project has multiple entries with different configuration. + + +
+ +[ExposedAPI](./rspeedy.exposedapi.md) + + + + +The exposed API of Rspeedy. Can be used in Rsbuild plugin with [api.useExposed](https://rsbuild.dev/plugins/dev/core#apiuseexposed). + + +
+ +[Filename](./rspeedy.filename.md) + + + + +The [Filename](./rspeedy.filename.md) determines the name of the JavaScript bundle file to be output. These bundles will be written to the directory specified by output.path. + + +
+ +[LoadConfigOptions](./rspeedy.loadconfigoptions.md) + + + + +The options of loadConfig. + + +
+ +[LoadConfigResult](./rspeedy.loadconfigresult.md) + + + + +The result of [loadConfig()](./rspeedy.loadconfig.md). + + +
+ +[Minify](./rspeedy.minify.md) + + + + +The [Minify](./rspeedy.minify.md) configures whether to enable code minification in the production build, or to configure minimizer options. + + +
+ +[Output](./rspeedy.output.md) + + + + +The [Output](./rspeedy.output.md) option is used to set how and where should the bundles and assets output. + + +
+ +[Performance](./rspeedy.performance.md) + + + + +The [Performance](./rspeedy.performance.md) option is used to optimize the build-time and runtime performance. + + +
+ +[Resolve](./rspeedy.resolve.md) + + + + +The [Resolve](./rspeedy.resolve.md) option is used to control the resolution behavior of Rspack. + + +
+ +[Server](./rspeedy.server.md) + + + + +The [Server](./rspeedy.server.md) option changes the behavior of dev-server. + + +
+ +[Source](./rspeedy.source.md) + + + + +The [Source](./rspeedy.source.md) option changes the behavior of source files. + + +
+ +[SourceMap](./rspeedy.sourcemap.md) + + + + +The [SourceMap](./rspeedy.sourcemap.md) configures whether and how to generate source-map for outputs. + + +
+ +[Tools](./rspeedy.tools.md) + + + + +The [Tools](./rspeedy.tools.md) options changes the behavior of various building tools. + + +
+ +[TransformImport](./rspeedy.transformimport.md) + + + + +The [TransformImport](./rspeedy.transformimport.md) option transforms the import paths to enable modular imports from subpaths of third-party packages, similar to the functionality provided by [babel-plugin-import](https://npmjs.com/package/babel-plugin-import). + + +
## Variables -| Variable | Description | -| --- | --- | -| [rspackVersion](./rspeedy.rspackversion.md) | | -| [version](./rspeedy.version.md) | | + + + +
+ +Variable + + + + +Description + + +
+ +[rspackVersion](./rspeedy.rspackversion.md) + + + + + +
+ +[version](./rspeedy.version.md) + + + + + +
## Type Aliases -| Type Alias | Description | -| --- | --- | -| [ConsoleType](./rspeedy.consoletype.md) | The type of the console method. | -| [CssModuleLocalsConvention](./rspeedy.cssmodulelocalsconvention.md) | The style of exported class names. | -| [Entry](./rspeedy.entry.md) | The [Entry](./rspeedy.entry.md) option is used to set the entry module. | -| [RsdoctorRspackPluginOptions](./rspeedy.rsdoctorrspackpluginoptions.md) | | -| [RspeedyInstance](./rspeedy.rspeedyinstance.md) | The instance of Rspeedy. | + + + + + + +
+ +Type Alias + + + + +Description + + +
+ +[ConsoleType](./rspeedy.consoletype.md) + + + + +The type of the console method. + + +
+ +[CssModuleLocalsConvention](./rspeedy.cssmodulelocalsconvention.md) + + + + +The style of exported class names. + + +
+ +[Entry](./rspeedy.entry.md) + + + + +The [Entry](./rspeedy.entry.md) option is used to set the entry module. + + +
+ +[RsdoctorRspackPluginOptions](./rspeedy.rsdoctorrspackpluginoptions.md) + + + + + +
+ +[RspeedyInstance](./rspeedy.rspeedyinstance.md) + + + + +The instance of Rspeedy. + +
diff --git a/docs/en/api/rspeedy/rspeedy.mergerspeedyconfig.md b/docs/en/api/rspeedy/rspeedy.mergerspeedyconfig.md index 370121c84..7a8fd4cd9 100644 --- a/docs/en/api/rspeedy/rspeedy.mergerspeedyconfig.md +++ b/docs/en/api/rspeedy/rspeedy.mergerspeedyconfig.md @@ -14,9 +14,39 @@ export declare function mergeRspeedyConfig(...configs: Config[]): Config; ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| configs | [Config](./rspeedy.config.md)\[\] | The Rspeedy configuration objects to merge. | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +configs + + + + +[Config](./rspeedy.config.md)\[\] + + + + +The Rspeedy configuration objects to merge. + + +
**Returns:** diff --git a/docs/en/api/rspeedy/rspeedy.minify.backgroundoptions.md b/docs/en/api/rspeedy/rspeedy.minify.backgroundoptions.md new file mode 100644 index 000000000..515052208 --- /dev/null +++ b/docs/en/api/rspeedy/rspeedy.minify.backgroundoptions.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [@lynx-js/rspeedy](./rspeedy.md) > [Minify](./rspeedy.minify.md) > [backgroundOptions](./rspeedy.minify.backgroundoptions.md) + +## Minify.backgroundOptions property + +[Minify.backgroundOptions](./rspeedy.minify.backgroundoptions.md) is used to override [Minify.jsOptions](./rspeedy.minify.jsoptions.md) for background-thread bundles. + +**Signature:** + +```typescript +backgroundOptions?: Rspack.SwcJsMinimizerRspackPluginOptions | undefined; +``` + +## Remarks + +This option is deep-merged into [Minify.jsOptions](./rspeedy.minify.jsoptions.md). It is mainly used together with ReactLynx dual-thread outputs so that main-thread and background-thread bundles can use different compress rules. + diff --git a/docs/en/api/rspeedy/rspeedy.minify.mainthreadoptions.md b/docs/en/api/rspeedy/rspeedy.minify.mainthreadoptions.md new file mode 100644 index 000000000..32e16a192 --- /dev/null +++ b/docs/en/api/rspeedy/rspeedy.minify.mainthreadoptions.md @@ -0,0 +1,46 @@ + + +[Home](./index.md) > [@lynx-js/rspeedy](./rspeedy.md) > [Minify](./rspeedy.minify.md) > [mainThreadOptions](./rspeedy.minify.mainthreadoptions.md) + +## Minify.mainThreadOptions property + +[Minify.mainThreadOptions](./rspeedy.minify.mainthreadoptions.md) is used to override [Minify.jsOptions](./rspeedy.minify.jsoptions.md) for main-thread bundles. + +**Signature:** + +```typescript +mainThreadOptions?: Rspack.SwcJsMinimizerRspackPluginOptions | undefined; +``` + +## Remarks + +This option is deep-merged into [Minify.jsOptions](./rspeedy.minify.jsoptions.md). It is mainly used together with ReactLynx dual-thread outputs so that main-thread and background-thread bundles can use different compress rules. + +## Example + + +```ts +import { defineConfig } from '@lynx-js/rspeedy' + +export default defineConfig({ + output: { + minify: { + jsOptions: { + minimizerOptions: { + compress: { + pure_funcs: ['console.log'], + }, + }, + }, + mainThreadOptions: { + minimizerOptions: { + compress: { + pure_funcs: ['NativeModules.call', 'lynx.getJSModule'], + }, + }, + }, + }, + }, +}) +``` + diff --git a/docs/en/api/rspeedy/rspeedy.minify.md b/docs/en/api/rspeedy/rspeedy.minify.md index 4068228d2..d36b54474 100644 --- a/docs/en/api/rspeedy/rspeedy.minify.md +++ b/docs/en/api/rspeedy/rspeedy.minify.md @@ -14,9 +14,121 @@ export interface Minify ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [css?](./rspeedy.minify.css.md) | | boolean \| undefined | _(Optional)_ Whether enable the CSS minification. | -| [js?](./rspeedy.minify.js.md) | | boolean \| undefined | _(Optional)_ Whether enable the JavaScript minification. | -| [jsOptions?](./rspeedy.minify.jsoptions.md) | | Rspack.SwcJsMinimizerRspackPluginOptions \| undefined | _(Optional)_ [Minify.jsOptions](./rspeedy.minify.jsoptions.md) is used to configure SWC minification options. | + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[backgroundOptions?](./rspeedy.minify.backgroundoptions.md) + + + + + + + +Rspack.SwcJsMinimizerRspackPluginOptions \| undefined + + + + +_(Optional)_ [Minify.backgroundOptions](./rspeedy.minify.backgroundoptions.md) is used to override [Minify.jsOptions](./rspeedy.minify.jsoptions.md) for background-thread bundles. + + +
+ +[css?](./rspeedy.minify.css.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ Whether enable the CSS minification. + + +
+ +[js?](./rspeedy.minify.js.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ Whether enable the JavaScript minification. + + +
+ +[jsOptions?](./rspeedy.minify.jsoptions.md) + + + + + + + +Rspack.SwcJsMinimizerRspackPluginOptions \| undefined + + + + +_(Optional)_ [Minify.jsOptions](./rspeedy.minify.jsoptions.md) is used to configure SWC minification options. + + +
+ +[mainThreadOptions?](./rspeedy.minify.mainthreadoptions.md) + + + + + + + +Rspack.SwcJsMinimizerRspackPluginOptions \| undefined + + + + +_(Optional)_ [Minify.mainThreadOptions](./rspeedy.minify.mainthreadoptions.md) is used to override [Minify.jsOptions](./rspeedy.minify.jsoptions.md) for main-thread bundles. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.output.md b/docs/en/api/rspeedy/rspeedy.output.md index e024b4d80..dfbaf8b37 100644 --- a/docs/en/api/rspeedy/rspeedy.output.md +++ b/docs/en/api/rspeedy/rspeedy.output.md @@ -14,18 +14,254 @@ export interface Output ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [assetPrefix?](./rspeedy.output.assetprefix.md) | | string \| undefined | _(Optional)_ The [Output.assetPrefix](./rspeedy.output.assetprefix.md) is used to set the URL prefix for static assets. | -| [cleanDistPath?](./rspeedy.output.cleandistpath.md) | | boolean \| undefined | _(Optional)_ The [Output.cleanDistPath](./rspeedy.output.cleandistpath.md) option determines whether all files in the output directory (default: dist) are removed before the build starts. | -| [copy?](./rspeedy.output.copy.md) | | Rspack.CopyRspackPluginOptions \| Rspack.CopyRspackPluginOptions\['patterns'\] \| undefined | _(Optional)_ The [Output.copy](./rspeedy.output.copy.md) option is used for copying files to the dist directory. | -| [cssModules?](./rspeedy.output.cssmodules.md) | | [CssModules](./rspeedy.cssmodules.md) \| undefined | _(Optional)_ The [CssModules](./rspeedy.cssmodules.md) option is used for the customization of CSS Modules configurations. | -| [dataUriLimit?](./rspeedy.output.dataurilimit.md) | | number \| DataUriLimit \| undefined | _(Optional)_ The [Output.dataUriLimit](./rspeedy.output.dataurilimit.md) option is used to set the size threshold to inline static assets such as images and fonts. | -| [distPath?](./rspeedy.output.distpath.md) | | [DistPath](./rspeedy.distpath.md) \| undefined | _(Optional)_ Set the directory of the dist files. | -| [filename?](./rspeedy.output.filename.md) | | string \| [Filename](./rspeedy.filename.md) \| undefined | _(Optional)_ The [Filename](./rspeedy.filename.md) determines the name of the JavaScript bundle file to be output. These bundles will be written to the directory specified by output.path. | -| [filenameHash?](./rspeedy.output.filenamehash.md) | | boolean \| string \| undefined | _(Optional)_ The [Output.filenameHash](./rspeedy.output.filenamehash.md) option controls whether to add a hash value to the filename after the production build. | -| [inlineScripts?](./rspeedy.output.inlinescripts.md) | | InlineChunkConfig \| undefined | _(Optional)_ The [Output.inlineScripts](./rspeedy.output.inlinescripts.md) option controls whether to inline scripts into Lynx bundle (.lynx.bundle). | -| [legalComments?](./rspeedy.output.legalcomments.md) | | 'none' \| 'inline' \| 'linked' \| undefined | _(Optional)_ The [Output.legalComments](./rspeedy.output.legalcomments.md) controls how to handle the legal comment. | -| [minify?](./rspeedy.output.minify.md) | | [Minify](./rspeedy.minify.md) \| boolean \| undefined | _(Optional)_ The [Minify](./rspeedy.minify.md) configures whether to enable code minification in the production build, or to configure minimizer options. | -| [sourceMap?](./rspeedy.output.sourcemap.md) | | boolean \| [SourceMap](./rspeedy.sourcemap.md) \| undefined | _(Optional)_ The [SourceMap](./rspeedy.sourcemap.md) configures whether and how to generate source-map for outputs. | + + + + + + + + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[assetPrefix?](./rspeedy.output.assetprefix.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ The [Output.assetPrefix](./rspeedy.output.assetprefix.md) is used to set the URL prefix for static assets. + + +
+ +[cleanDistPath?](./rspeedy.output.cleandistpath.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ The [Output.cleanDistPath](./rspeedy.output.cleandistpath.md) option determines whether all files in the output directory (default: `dist`) are removed before the build starts. + + +
+ +[copy?](./rspeedy.output.copy.md) + + + + + + + +Rspack.CopyRspackPluginOptions \| Rspack.CopyRspackPluginOptions\['patterns'\] \| undefined + + + + +_(Optional)_ The [Output.copy](./rspeedy.output.copy.md) option is used for copying files to the dist directory. + + +
+ +[cssModules?](./rspeedy.output.cssmodules.md) + + + + + + + +[CssModules](./rspeedy.cssmodules.md) \| undefined + + + + +_(Optional)_ The [CssModules](./rspeedy.cssmodules.md) option is used for the customization of CSS Modules configurations. + + +
+ +[dataUriLimit?](./rspeedy.output.dataurilimit.md) + + + + + + + +number \| DataUriLimit \| undefined + + + + +_(Optional)_ The [Output.dataUriLimit](./rspeedy.output.dataurilimit.md) option is used to set the size threshold to inline static assets such as images and fonts. + + +
+ +[distPath?](./rspeedy.output.distpath.md) + + + + + + + +[DistPath](./rspeedy.distpath.md) \| undefined + + + + +_(Optional)_ Set the directory of the dist files. + + +
+ +[filename?](./rspeedy.output.filename.md) + + + + + + + +string \| [Filename](./rspeedy.filename.md) \| undefined + + + + +_(Optional)_ The [Filename](./rspeedy.filename.md) determines the name of the JavaScript bundle file to be output. These bundles will be written to the directory specified by output.path. + + +
+ +[filenameHash?](./rspeedy.output.filenamehash.md) + + + + + + + +boolean \| string \| undefined + + + + +_(Optional)_ The [Output.filenameHash](./rspeedy.output.filenamehash.md) option controls whether to add a hash value to the filename after the production build. + + +
+ +[inlineScripts?](./rspeedy.output.inlinescripts.md) + + + + + + + +InlineChunkConfig \| undefined + + + + +_(Optional)_ The [Output.inlineScripts](./rspeedy.output.inlinescripts.md) option controls whether to inline scripts into Lynx bundle (`.lynx.bundle`). + + +
+ +[legalComments?](./rspeedy.output.legalcomments.md) + + + + + + + +'none' \| 'inline' \| 'linked' \| undefined + + + + +_(Optional)_ The [Output.legalComments](./rspeedy.output.legalcomments.md) controls how to handle the legal comment. + + +
+ +[minify?](./rspeedy.output.minify.md) + + + + + + + +[Minify](./rspeedy.minify.md) \| boolean \| undefined + + + + +_(Optional)_ The [Minify](./rspeedy.minify.md) configures whether to enable code minification in the production build, or to configure minimizer options. + + +
+ +[sourceMap?](./rspeedy.output.sourcemap.md) + + + + + + + +boolean \| [SourceMap](./rspeedy.sourcemap.md) \| undefined + + + + +_(Optional)_ The [SourceMap](./rspeedy.sourcemap.md) configures whether and how to generate source-map for outputs. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.performance.md b/docs/en/api/rspeedy/rspeedy.performance.md index 0212b75e5..acb66c62e 100644 --- a/docs/en/api/rspeedy/rspeedy.performance.md +++ b/docs/en/api/rspeedy/rspeedy.performance.md @@ -14,11 +14,127 @@ export interface Performance ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [buildCache?](./rspeedy.performance.buildcache.md) | | [BuildCache](./rspeedy.buildcache.md) \| boolean \| undefined |

**_(BETA)_** _(Optional)_ Enable or configure persistent build cache.

This feature is experimental and may be changed in the future.

| -| [chunkSplit?](./rspeedy.performance.chunksplit.md) | | [ChunkSplit](./rspeedy.chunksplit.md) \| [ChunkSplitBySize](./rspeedy.chunksplitbysize.md) \| [ChunkSplitCustom](./rspeedy.chunksplitcustom.md) \| undefined | _(Optional)_ [Performance.chunkSplit](./rspeedy.performance.chunksplit.md) is used to configure the chunk splitting strategy. | -| [printFileSize?](./rspeedy.performance.printfilesize.md) | | PerformanceConfig\['printFileSize'\] \| undefined |

_(Optional)_ Whether to print the file sizes after production build.

[Performance.printFileSize](./rspeedy.performance.printfilesize.md)

See [Rsbuild - performance.printFileSize](https://rsbuild.dev/config/performance/print-file-size) for details.

| -| [profile?](./rspeedy.performance.profile.md) | | boolean \| undefined | _(Optional)_ Whether capture timing information in the build time and the runtime, the same as the [profile](https://rspack.dev/config/other-options#profile) config of Rspack. | -| [removeConsole?](./rspeedy.performance.removeconsole.md) | | boolean \| [ConsoleType](./rspeedy.consoletype.md)\[\] \| undefined | _(Optional)_ Whether to remove console.[methodName] in production build. | + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[buildCache?](./rspeedy.performance.buildcache.md) + + + + + + + +[BuildCache](./rspeedy.buildcache.md) \| boolean \| undefined + + + + +**_(BETA)_** _(Optional)_ Enable or configure persistent build cache. + +This feature is experimental and may be changed in the future. + + +
+ +[chunkSplit?](./rspeedy.performance.chunksplit.md) + + + + + + + +[ChunkSplit](./rspeedy.chunksplit.md) \| [ChunkSplitBySize](./rspeedy.chunksplitbysize.md) \| [ChunkSplitCustom](./rspeedy.chunksplitcustom.md) \| undefined + + + + +_(Optional)_ [Performance.chunkSplit](./rspeedy.performance.chunksplit.md) is used to configure the chunk splitting strategy. + + +
+ +[printFileSize?](./rspeedy.performance.printfilesize.md) + + + + + + + +PerformanceConfig\['printFileSize'\] \| undefined + + + + +_(Optional)_ Whether to print the file sizes after production build. + +[Performance.printFileSize](./rspeedy.performance.printfilesize.md) + +See [Rsbuild - performance.printFileSize](https://rsbuild.dev/config/performance/print-file-size) for details. + + +
+ +[profile?](./rspeedy.performance.profile.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ Whether capture timing information in the build time and the runtime, the same as the [profile](https://rspack.dev/config/other-options#profile) config of Rspack. + + +
+ +[removeConsole?](./rspeedy.performance.removeconsole.md) + + + + + + + +boolean \| [ConsoleType](./rspeedy.consoletype.md)\[\] \| undefined + + + + +_(Optional)_ Whether to remove `console.[methodName]` in production build. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.resolve.md b/docs/en/api/rspeedy/rspeedy.resolve.md index 7253f1039..3899ca6c4 100644 --- a/docs/en/api/rspeedy/rspeedy.resolve.md +++ b/docs/en/api/rspeedy/rspeedy.resolve.md @@ -14,10 +14,120 @@ export interface Resolve ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [alias?](./rspeedy.resolve.alias.md) | | Record<string, string \| false \| string\[\]> \| undefined | _(Optional)_ Create aliases to import or require certain modules more easily. | -| [aliasStrategy?](./rspeedy.resolve.aliasstrategy.md) | | 'prefer-tsconfig' \| 'prefer-alias' \| undefined | _(Optional)_ Set the strategy for path alias resolution, to control the priority relationship between the paths option in tsconfig.json and the resolve.alias option of Rsbuild. - prefer-tsconfig (default): The paths option in tsconfig.json will take precedence over the resolve.alias option of Rsbuild. - prefer-alias: The resolve.alias option of Rsbuild will take precedence over the paths option in tsconfig.json. | -| [dedupe?](./rspeedy.resolve.dedupe.md) | | string\[\] \| undefined | _(Optional)_ Force to resolve the specified packages from project root, which is useful for deduplicating packages and reducing the bundle size. | -| [extensions?](./rspeedy.resolve.extensions.md) | | string\[\] \| undefined |

_(Optional)_ Automatically resolve file extensions when importing modules. This means you can import files without explicitly writing their extensions.

Default: ['.ts', '.tsx', '.mjs', '.js', '.jsx', '.json', '.cjs']

For example, if importing './index', Rsbuild will try to resolve using the following order:

- ./index.ts

- ./index.tsx

- ./index.mjs

- ./index.js

- ./index.jsx

- ./index.json

- ./index.cjs

| + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[alias?](./rspeedy.resolve.alias.md) + + + + + + + +Record<string, string \| false \| string\[\]> \| undefined + + + + +_(Optional)_ Create aliases to `import` or `require` certain modules more easily. + + +
+ +[aliasStrategy?](./rspeedy.resolve.aliasstrategy.md) + + + + + + + +'prefer-tsconfig' \| 'prefer-alias' \| undefined + + + + +_(Optional)_ Set the strategy for path alias resolution, to control the priority relationship between the `paths` option in `tsconfig.json` and the `resolve.alias` option of Rsbuild. - `prefer-tsconfig` (default): The `paths` option in `tsconfig.json` will take precedence over the `resolve.alias` option of Rsbuild. - `prefer-alias`: The `resolve.alias` option of Rsbuild will take precedence over the `paths` option in `tsconfig.json`. + + +
+ +[dedupe?](./rspeedy.resolve.dedupe.md) + + + + + + + +string\[\] \| undefined + + + + +_(Optional)_ Force to resolve the specified packages from project root, which is useful for deduplicating packages and reducing the bundle size. + + +
+ +[extensions?](./rspeedy.resolve.extensions.md) + + + + + + + +string\[\] \| undefined + + + + +_(Optional)_ Automatically resolve file extensions when importing modules. This means you can import files without explicitly writing their extensions. + +Default: `['.ts', '.tsx', '.mjs', '.js', '.jsx', '.json', '.cjs']` + +For example, if importing './index', Rsbuild will try to resolve using the following order: + +- `./index.ts` + +- `./index.tsx` + +- `./index.mjs` + +- `./index.js` + +- `./index.jsx` + +- `./index.json` + +- `./index.cjs` + + +
diff --git a/docs/en/api/rspeedy/rspeedy.server.md b/docs/en/api/rspeedy/rspeedy.server.md index 87e0264d5..8c3feba04 100644 --- a/docs/en/api/rspeedy/rspeedy.server.md +++ b/docs/en/api/rspeedy/rspeedy.server.md @@ -14,14 +14,192 @@ export interface Server ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [base?](./rspeedy.server.base.md) | | string \| undefined | _(Optional)_ Configure the base path of the server. | -| [compress?](./rspeedy.server.compress.md) | | boolean \| CompressOptions \| undefined |

_(Optional)_ Configure whether to enable [gzip compression](https://developer.mozilla.org/en-US/docs/Glossary/gzip_compression) for static assets served by the dev server or preview server.

Default: true

See [Rsbuild - server.compress](https://rsbuild.rs/config/server/compress) for details.

| -| [cors?](./rspeedy.server.cors.md) | | ServerConfig\['cors'\] \| undefined |

_(Optional)_ Configure CORS for the dev server or preview server.

- Set to an object to enable CORS with the specified options.

- Set to true to enable CORS with the default options (allows all origins, not recommended).

- Set to false to disable CORS.

See [Rsbuild - server.cors](https://rsbuild.rs/config/server/cors) for details.

| -| [headers?](./rspeedy.server.headers.md) | | Record<string, string \| string\[\]> \| undefined | _(Optional)_ Adds headers to all responses. | -| [host?](./rspeedy.server.host.md) | | string \| undefined | _(Optional)_ Specify the host that the Rspeedy Server listens to. | -| [port?](./rspeedy.server.port.md) | | number \| undefined | _(Optional)_ Specify the port that the Rspeedy Server listens to. | -| [proxy?](./rspeedy.server.proxy.md) | | ProxyConfig \| undefined | _(Optional)_ Configure proxy rules for the dev server or preview server to proxy requests to the specified service. | -| [strictPort?](./rspeedy.server.strictport.md) | | boolean \| undefined |

_(Optional)_ When a port is occupied, Rspeedy will automatically increment the port number until an available port is found.

Set strictPort to true and Rspeedy will throw an exception when the port is occupied.

| + + + + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[base?](./rspeedy.server.base.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ Configure the base path of the server. + + +
+ +[compress?](./rspeedy.server.compress.md) + + + + + + + +boolean \| CompressOptions \| undefined + + + + +_(Optional)_ Configure whether to enable [gzip compression](https://developer.mozilla.org/en-US/docs/Glossary/gzip_compression) for static assets served by the dev server or preview server. + +Default: true + +See [Rsbuild - server.compress](https://rsbuild.rs/config/server/compress) for details. + + +
+ +[cors?](./rspeedy.server.cors.md) + + + + + + + +ServerConfig\['cors'\] \| undefined + + + + +_(Optional)_ Configure CORS for the dev server or preview server. + +- Set to an object to enable CORS with the specified options. + +- Set to `true` to enable CORS with the default options (allows all origins, not recommended). + +- Set to `false` to disable CORS. + +See [Rsbuild - server.cors](https://rsbuild.rs/config/server/cors) for details. + + +
+ +[headers?](./rspeedy.server.headers.md) + + + + + + + +Record<string, string \| string\[\]> \| undefined + + + + +_(Optional)_ Adds headers to all responses. + + +
+ +[host?](./rspeedy.server.host.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ Specify the host that the Rspeedy Server listens to. + + +
+ +[port?](./rspeedy.server.port.md) + + + + + + + +number \| undefined + + + + +_(Optional)_ Specify the port that the Rspeedy Server listens to. + + +
+ +[proxy?](./rspeedy.server.proxy.md) + + + + + + + +ProxyConfig \| undefined + + + + +_(Optional)_ Configure proxy rules for the dev server or preview server to proxy requests to the specified service. + + +
+ +[strictPort?](./rspeedy.server.strictport.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ When a port is occupied, Rspeedy will automatically increment the port number until an available port is found. + +Set strictPort to true and Rspeedy will throw an exception when the port is occupied. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.source.entry.md b/docs/en/api/rspeedy/rspeedy.source.entry.md index 3513381a3..22792a7d0 100644 --- a/docs/en/api/rspeedy/rspeedy.source.entry.md +++ b/docs/en/api/rspeedy/rspeedy.source.entry.md @@ -12,6 +12,10 @@ The [Entry](./rspeedy.entry.md) option is used to set the entry module. entry?: Entry | undefined; ``` +## Default Value + +`'./src/index.js'` + ## Remarks If no value is provided, the default value `'./src/index.js'` will be used. diff --git a/docs/en/api/rspeedy/rspeedy.source.md b/docs/en/api/rspeedy/rspeedy.source.md index 8e87a6824..c5ce2eb95 100644 --- a/docs/en/api/rspeedy/rspeedy.source.md +++ b/docs/en/api/rspeedy/rspeedy.source.md @@ -14,16 +14,216 @@ export interface Source ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [alias?](./rspeedy.source.alias.md) | | Record<string, string \| false \| string\[\]> \| undefined | _(Optional)_ Create aliases to import or require certain modules more easily. | -| [assetsInclude?](./rspeedy.source.assetsinclude.md) | | Rspack.RuleSetCondition \| undefined | _(Optional)_ Include additional files that should be treated as static assets. Defaults to be undefined. | -| [decorators?](./rspeedy.source.decorators.md) | | [Decorators](./rspeedy.decorators.md) \| undefined | _(Optional)_ Used to configure the decorators syntax. | -| [define?](./rspeedy.source.define.md) | | Record<string, string \| number \| boolean \| undefined \| Record<string, unknown>> \| undefined | _(Optional)_ The define options is used to define some values or expressions at compile time. | -| [entry?](./rspeedy.source.entry.md) | | [Entry](./rspeedy.entry.md) \| undefined | _(Optional)_ The [Entry](./rspeedy.entry.md) option is used to set the entry module. | -| [exclude?](./rspeedy.source.exclude.md) | | Rspack.RuleSetCondition\[\] \| undefined | _(Optional)_ The source.exclude is used to specify JavaScript files that should be excluded from compilation. | -| [include?](./rspeedy.source.include.md) | | Rspack.RuleSetCondition\[\] \| undefined | _(Optional)_ The source.include is used to specify additional JavaScript files that need to be compiled. | -| [preEntry?](./rspeedy.source.preentry.md) | | string \| string\[\] \| undefined | _(Optional)_ Add a script before the entry file of each page. This script will be executed before the page code. It can be used to execute global logics, such as injecting polyfills, setting global styles, etc. | -| [transformImport?](./rspeedy.source.transformimport.md) | | [TransformImport](./rspeedy.transformimport.md)\[\] \| undefined | _(Optional)_ The [TransformImport](./rspeedy.transformimport.md) option transforms the import paths to enable modular imports from subpaths of third-party packages, similar to the functionality provided by [babel-plugin-import](https://npmjs.com/package/babel-plugin-import). | -| [tsconfigPath?](./rspeedy.source.tsconfigpath.md) | | string \| undefined | _(Optional)_ Configure a custom tsconfig.json file path to use, can be a relative or absolute path. Defaults to be ./tsconfig.json. | + + + + + + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[alias?](./rspeedy.source.alias.md) + + + + + + + +Record<string, string \| false \| string\[\]> \| undefined + + + + +_(Optional)_ Create aliases to `import` or `require` certain modules more easily. + + +
+ +[assetsInclude?](./rspeedy.source.assetsinclude.md) + + + + + + + +Rspack.RuleSetCondition \| undefined + + + + +_(Optional)_ Include additional files that should be treated as static assets. Defaults to be `undefined`. + + +
+ +[decorators?](./rspeedy.source.decorators.md) + + + + + + + +[Decorators](./rspeedy.decorators.md) \| undefined + + + + +_(Optional)_ Used to configure the decorators syntax. + + +
+ +[define?](./rspeedy.source.define.md) + + + + + + + +Record<string, string \| number \| boolean \| undefined \| Record<string, unknown>> \| undefined + + + + +_(Optional)_ The `define` options is used to define some values or expressions at compile time. + + +
+ +[entry?](./rspeedy.source.entry.md) + + + + + + + +[Entry](./rspeedy.entry.md) \| undefined + + + + +_(Optional)_ The [Entry](./rspeedy.entry.md) option is used to set the entry module. + + +
+ +[exclude?](./rspeedy.source.exclude.md) + + + + + + + +Rspack.RuleSetCondition\[\] \| undefined + + + + +_(Optional)_ The `source.exclude` is used to specify JavaScript files that should be excluded from compilation. + + +
+ +[include?](./rspeedy.source.include.md) + + + + + + + +Rspack.RuleSetCondition\[\] \| undefined + + + + +_(Optional)_ The `source.include` is used to specify additional JavaScript files that need to be compiled. + + +
+ +[preEntry?](./rspeedy.source.preentry.md) + + + + + + + +string \| string\[\] \| undefined + + + + +_(Optional)_ Add a script before the entry file of each page. This script will be executed before the page code. It can be used to execute global logics, such as injecting polyfills, setting global styles, etc. + + +
+ +[transformImport?](./rspeedy.source.transformimport.md) + + + + + + + +[TransformImport](./rspeedy.transformimport.md)\[\] \| undefined + + + + +_(Optional)_ The [TransformImport](./rspeedy.transformimport.md) option transforms the import paths to enable modular imports from subpaths of third-party packages, similar to the functionality provided by [babel-plugin-import](https://npmjs.com/package/babel-plugin-import). + + +
+ +[tsconfigPath?](./rspeedy.source.tsconfigpath.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ Configure a custom `tsconfig.json` file path to use, can be a relative or absolute path. Defaults to be `./tsconfig.json`. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.sourcemap.md b/docs/en/api/rspeedy/rspeedy.sourcemap.md index b80a4193f..7ff28f60c 100644 --- a/docs/en/api/rspeedy/rspeedy.sourcemap.md +++ b/docs/en/api/rspeedy/rspeedy.sourcemap.md @@ -14,7 +14,45 @@ export interface SourceMap ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [js?](./rspeedy.sourcemap.js.md) | | Rspack.DevTool \| undefined \| \`${Exclude<Rspack.DevTool, false \| 'eval'>}-debugids\` | _(Optional)_ How the source map should be generated. Setting it to false will disable the source map. | + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[js?](./rspeedy.sourcemap.js.md) + + + + + + + +Rspack.DevTool \| undefined \| \`${Exclude<Rspack.DevTool, false \| 'eval'>}-debugids\` + + + + +_(Optional)_ How the source map should be generated. Setting it to `false` will disable the source map. + + +
diff --git a/docs/en/api/rspeedy/rspeedy.tools.md b/docs/en/api/rspeedy/rspeedy.tools.md index b6291742e..6068182c9 100644 --- a/docs/en/api/rspeedy/rspeedy.tools.md +++ b/docs/en/api/rspeedy/rspeedy.tools.md @@ -14,12 +14,140 @@ export interface Tools ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [bundlerChain?](./rspeedy.tools.bundlerchain.md) | | ToolsConfig\['bundlerChain'\] \| undefined | _(Optional)_ The [Tools.bundlerChain](./rspeedy.tools.bundlerchain.md) changes the options of [Rspack](https://www.rspack.dev) using [rspack-chain](https://github.com/rspack-contrib/rspack-chain). | -| [cssExtract?](./rspeedy.tools.cssextract.md) | | [CssExtract](./rspeedy.cssextract.md) \| undefined | _(Optional)_ The [CssExtract](./rspeedy.cssextract.md) controls the options of [CssExtractRspackPlugin](https://www.rspack.dev/plugins/rspack/css-extract-rspack-plugin) | -| [cssLoader?](./rspeedy.tools.cssloader.md) | | [CssLoader](./rspeedy.cssloader.md) \| undefined | _(Optional)_ The [CssLoader](./rspeedy.cssloader.md) controls the options of [css-loader](https://github.com/webpack-contrib/css-loader). | -| [rsdoctor?](./rspeedy.tools.rsdoctor.md) | | [RsdoctorRspackPluginOptions](./rspeedy.rsdoctorrspackpluginoptions.md) \| undefined | _(Optional)_ The [Tools.rsdoctor](./rspeedy.tools.rsdoctor.md) controls the options of [Rsdoctor](https://rsdoctor.dev/). | -| [rspack?](./rspeedy.tools.rspack.md) | | ToolsConfig\['rspack'\] \| undefined | _(Optional)_ The [Tools.rspack](./rspeedy.tools.rspack.md) controls the options of [Rspack](https://www.rspack.dev/). | -| [swc?](./rspeedy.tools.swc.md) | | ToolsConfig\['swc'\] \| undefined | _(Optional)_ The [Tools.swc](./rspeedy.tools.swc.md) controls the options of [builtin:swc-loader](https://rspack.dev/guide/features/builtin-swc-loader). | + + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[bundlerChain?](./rspeedy.tools.bundlerchain.md) + + + + + + + +ToolsConfig\['bundlerChain'\] \| undefined + + + + +_(Optional)_ The [Tools.bundlerChain](./rspeedy.tools.bundlerchain.md) changes the options of [Rspack](https://www.rspack.dev) using [rspack-chain](https://github.com/rspack-contrib/rspack-chain). + + +
+ +[cssExtract?](./rspeedy.tools.cssextract.md) + + + + + + + +[CssExtract](./rspeedy.cssextract.md) \| undefined + + + + +_(Optional)_ The [CssExtract](./rspeedy.cssextract.md) controls the options of [CssExtractRspackPlugin](https://www.rspack.dev/plugins/rspack/css-extract-rspack-plugin) + + +
+ +[cssLoader?](./rspeedy.tools.cssloader.md) + + + + + + + +[CssLoader](./rspeedy.cssloader.md) \| undefined + + + + +_(Optional)_ The [CssLoader](./rspeedy.cssloader.md) controls the options of [css-loader](https://github.com/webpack-contrib/css-loader). + + +
+ +[rsdoctor?](./rspeedy.tools.rsdoctor.md) + + + + + + + +[RsdoctorRspackPluginOptions](./rspeedy.rsdoctorrspackpluginoptions.md) \| undefined + + + + +_(Optional)_ The [Tools.rsdoctor](./rspeedy.tools.rsdoctor.md) controls the options of [Rsdoctor](https://rsdoctor.dev/). + + +
+ +[rspack?](./rspeedy.tools.rspack.md) + + + + + + + +ToolsConfig\['rspack'\] \| undefined + + + + +_(Optional)_ The [Tools.rspack](./rspeedy.tools.rspack.md) controls the options of [Rspack](https://www.rspack.dev/). + + +
+ +[swc?](./rspeedy.tools.swc.md) + + + + + + + +ToolsConfig\['swc'\] \| undefined + + + + +_(Optional)_ The [Tools.swc](./rspeedy.tools.swc.md) controls the options of [builtin:swc-loader](https://rspack.dev/guide/features/builtin-swc-loader). + + +
diff --git a/docs/en/api/rspeedy/rspeedy.transformimport.md b/docs/en/api/rspeedy/rspeedy.transformimport.md index d917424d7..8fb1e6a98 100644 --- a/docs/en/api/rspeedy/rspeedy.transformimport.md +++ b/docs/en/api/rspeedy/rspeedy.transformimport.md @@ -14,11 +14,121 @@ export interface TransformImport ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [camelToDashComponentName?](./rspeedy.transformimport.cameltodashcomponentname.md) | | boolean \| undefined | _(Optional)_ Whether to convert camelCase imports to kebab-case. | -| [customName?](./rspeedy.transformimport.customname.md) | | string \| undefined | _(Optional)_ Customize the transformed path. | -| [libraryDirectory?](./rspeedy.transformimport.librarydirectory.md) | | string \| undefined | _(Optional)_ Used to splice the transformed path, the splicing rule is ${libraryName}/${libraryDirectory}/${member}, where member is the imported member. | -| [libraryName](./rspeedy.transformimport.libraryname.md) | | string | The original import path that needs to be transformed. | -| [transformToDefaultImport?](./rspeedy.transformimport.transformtodefaultimport.md) | | boolean \| undefined | _(Optional)_ Whether to convert import statements to default imports. | + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[camelToDashComponentName?](./rspeedy.transformimport.cameltodashcomponentname.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ Whether to convert camelCase imports to kebab-case. + + +
+ +[customName?](./rspeedy.transformimport.customname.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ Customize the transformed path. + + +
+ +[libraryDirectory?](./rspeedy.transformimport.librarydirectory.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ Used to splice the transformed path, the splicing rule is `${libraryName}/${libraryDirectory}/${member}`, where member is the imported member. + + +
+ +[libraryName](./rspeedy.transformimport.libraryname.md) + + + + + + + +string + + + + +The original import path that needs to be transformed. + + +
+ +[transformToDefaultImport?](./rspeedy.transformimport.transformtodefaultimport.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ Whether to convert import statements to default imports. + + +
diff --git a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin._constructor_.md b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin._constructor_.md index 7415b5ea0..a71fed5bf 100644 --- a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin._constructor_.md +++ b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin._constructor_.md @@ -14,7 +14,35 @@ constructor(options: ExternalsLoadingPluginOptions); ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| options | [ExternalsLoadingPluginOptions](./externals-loading-webpack-plugin.externalsloadingpluginoptions.md) | | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +options + + + + +[ExternalsLoadingPluginOptions](./externals-loading-webpack-plugin.externalsloadingpluginoptions.md) + + + + + +
diff --git a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin.apply.md b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin.apply.md index fe8c11abc..f8f478a46 100644 --- a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin.apply.md +++ b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin.apply.md @@ -12,9 +12,37 @@ apply(compiler: Compiler): void; ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| compiler | Compiler | | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +compiler + + + + +Compiler + + + + + +
**Returns:** diff --git a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin.md b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin.md index bf53e1e7e..648d3459b 100644 --- a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin.md +++ b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingplugin.md @@ -45,13 +45,67 @@ export default { ## Constructors -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(options)](./externals-loading-webpack-plugin.externalsloadingplugin._constructor_.md) | | Constructs a new instance of the ExternalsLoadingPlugin class | + + +
+ +Constructor + + + + +Modifiers + + + + +Description + + +
+ +[(constructor)(options)](./externals-loading-webpack-plugin.externalsloadingplugin._constructor_.md) + + + + + + + +Constructs a new instance of the `ExternalsLoadingPlugin` class + + +
## Methods -| Method | Modifiers | Description | -| --- | --- | --- | -| [apply(compiler)](./externals-loading-webpack-plugin.externalsloadingplugin.apply.md) | | | + + +
+ +Method + + + + +Modifiers + + + + +Description + + +
+ +[apply(compiler)](./externals-loading-webpack-plugin.externalsloadingplugin.apply.md) + + + + + + + + +
diff --git a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.globalobject.md b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.globalobject.md new file mode 100644 index 000000000..02b001e1a --- /dev/null +++ b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.globalobject.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [@lynx-js/externals-loading-webpack-plugin](./externals-loading-webpack-plugin.md) > [ExternalsLoadingPluginOptions](./externals-loading-webpack-plugin.externalsloadingpluginoptions.md) > [globalObject](./externals-loading-webpack-plugin.externalsloadingpluginoptions.globalobject.md) + +## ExternalsLoadingPluginOptions.globalObject property + +This option indicates what global object will be used to mount the library. + +In Lynx, the library will be mounted to `lynx[Symbol.for("__LYNX_EXTERNAL_GLOBAL__")]` by default. + +If you have enabled share js context and want to reuse the library by mounting to the global object, you can set this option to `'globalThis'`. + + 'lynx' + +**Signature:** + +```typescript +globalObject?: 'lynx' | 'globalThis' | undefined; +``` diff --git a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.md b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.md index a8382ffa5..21d42b005 100644 --- a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.md +++ b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.md @@ -14,9 +14,127 @@ export interface ExternalsLoadingPluginOptions ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [backgroundLayer](./externals-loading-webpack-plugin.externalsloadingpluginoptions.backgroundlayer.md) | | string | The name of the background layer. | -| [externals](./externals-loading-webpack-plugin.externalsloadingpluginoptions.externals.md) | | Record<string, [ExternalValue](./externals-loading-webpack-plugin.externalvalue.md)> | Specify the externals to be loaded. The externals should be Lynx Bundles. | -| [mainThreadLayer](./externals-loading-webpack-plugin.externalsloadingpluginoptions.mainthreadlayer.md) | | string | The name of the main thread layer. | + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[backgroundLayer](./externals-loading-webpack-plugin.externalsloadingpluginoptions.backgroundlayer.md) + + + + + + + +string + + + + +The name of the background layer. + + +
+ +[externals](./externals-loading-webpack-plugin.externalsloadingpluginoptions.externals.md) + + + + + + + +Record<string, [ExternalValue](./externals-loading-webpack-plugin.externalvalue.md)> + + + + +Specify the externals to be loaded. The externals should be Lynx Bundles. + + +
+ +[globalObject?](./externals-loading-webpack-plugin.externalsloadingpluginoptions.globalobject.md) + + + + + + + +'lynx' \| 'globalThis' \| undefined + + + + +_(Optional)_ This option indicates what global object will be used to mount the library. + +In Lynx, the library will be mounted to `lynx[Symbol.for("__LYNX_EXTERNAL_GLOBAL__")]` by default. + +If you have enabled share js context and want to reuse the library by mounting to the global object, you can set this option to `'globalThis'`. + + 'lynx' + + +
+ +[mainThreadLayer](./externals-loading-webpack-plugin.externalsloadingpluginoptions.mainthreadlayer.md) + + + + + + + +string + + + + +The name of the main thread layer. + + +
+ +[timeout?](./externals-loading-webpack-plugin.externalsloadingpluginoptions.timeout.md) + + + + + + + +number \| undefined + + + + +_(Optional)_ The timeout in milliseconds for loading the externals. + + +
diff --git a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.timeout.md b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.timeout.md new file mode 100644 index 000000000..f12bda3e4 --- /dev/null +++ b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalsloadingpluginoptions.timeout.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [@lynx-js/externals-loading-webpack-plugin](./externals-loading-webpack-plugin.md) > [ExternalsLoadingPluginOptions](./externals-loading-webpack-plugin.externalsloadingpluginoptions.md) > [timeout](./externals-loading-webpack-plugin.externalsloadingpluginoptions.timeout.md) + +## ExternalsLoadingPluginOptions.timeout property + +The timeout in milliseconds for loading the externals. + +**Signature:** + +```typescript +timeout?: number | undefined; +``` + +## Default Value + +2000 + diff --git a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.async.md b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.async.md index e765534f5..ee68855c5 100644 --- a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.async.md +++ b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.async.md @@ -11,3 +11,8 @@ Whether the source should be loaded asynchronously or not. ```typescript async?: boolean; ``` + +## Default Value + +`true` + diff --git a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.background.md b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.background.md index fa3796edf..fcbdad882 100644 --- a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.background.md +++ b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.background.md @@ -11,3 +11,8 @@ The options of the background layer. ```typescript background?: LayerOptions; ``` + +## Default Value + +`undefined` + diff --git a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.bundlepath.md b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.bundlepath.md new file mode 100644 index 000000000..9dbc0adb1 --- /dev/null +++ b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.bundlepath.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [@lynx-js/externals-loading-webpack-plugin](./externals-loading-webpack-plugin.md) > [ExternalValue](./externals-loading-webpack-plugin.externalvalue.md) > [bundlePath](./externals-loading-webpack-plugin.externalvalue.bundlepath.md) + +## ExternalValue.bundlePath property + +The bundle path resolved against the runtime public path. + +Prefer this over `url` when the bundle should follow the active `publicPath`. The runtime will load it with `publicPath + bundlePath`, which keeps external bundle resolution aligned with the current build output without hard-coding an absolute URL into the generated runtime code. + +**Signature:** + +```typescript +bundlePath?: string; +``` diff --git a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.libraryname.md b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.libraryname.md index 1c6d3c64d..911171e19 100644 --- a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.libraryname.md +++ b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.libraryname.md @@ -76,6 +76,10 @@ externals: { libraryName?: string | string[]; ``` +## Default Value + +`undefined` + ## Example `Lodash` diff --git a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.mainthread.md b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.mainthread.md index b3d5686bc..354023d0b 100644 --- a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.mainthread.md +++ b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.mainthread.md @@ -11,3 +11,8 @@ The options of the main-thread layer. ```typescript mainThread?: LayerOptions; ``` + +## Default Value + +`undefined` + diff --git a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.md b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.md index 800959915..8977676a5 100644 --- a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.md +++ b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.md @@ -4,6 +4,7 @@ ## ExternalValue interface +The value item of the externals. **Signature:** @@ -13,11 +14,107 @@ export interface ExternalValue ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [async?](./externals-loading-webpack-plugin.externalvalue.async.md) | | boolean | _(Optional)_ Whether the source should be loaded asynchronously or not. | -| [background?](./externals-loading-webpack-plugin.externalvalue.background.md) | | [LayerOptions](./externals-loading-webpack-plugin.layeroptions.md) | _(Optional)_ The options of the background layer. | -| [libraryName?](./externals-loading-webpack-plugin.externalvalue.libraryname.md) | | string \| string\[\] |

_(Optional)_ The name of the library. Same as https://webpack.js.org/configuration/externals/\#string.

By default, the library name is the same as the externals key. For example:

The config

+ + + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[async?](./externals-loading-webpack-plugin.externalvalue.async.md) + + + + + + + +boolean + + + + +_(Optional)_ Whether the source should be loaded asynchronously or not. + + +
+ +[background?](./externals-loading-webpack-plugin.externalvalue.background.md) + + + + + + + +[LayerOptions](./externals-loading-webpack-plugin.layeroptions.md) + + + + +_(Optional)_ The options of the background layer. + + +
+ +[bundlePath?](./externals-loading-webpack-plugin.externalvalue.bundlepath.md) + + + + + + + +string + + + + +_(Optional)_ The bundle path resolved against the runtime public path. + +Prefer this over `url` when the bundle should follow the active `publicPath`. The runtime will load it with `publicPath + bundlePath`, which keeps external bundle resolution aligned with the current build output without hard-coding an absolute URL into the generated runtime code. + + +
+ +[libraryName?](./externals-loading-webpack-plugin.externalvalue.libraryname.md) + + + + + + + +string \| string\[\] + + + + +_(Optional)_ The name of the library. Same as https://webpack.js.org/configuration/externals/\#string. + +By default, the library name is the same as the externals key. For example: + +The config + ```js ExternalsLoadingPlugin({ externals: { @@ -27,13 +124,15 @@ ExternalsLoadingPlugin({ } }) ``` -

Will generate the following webpack externals config:

+Will generate the following webpack externals config: + ```js externals: { lodash: 'lynx[Symbol.for("__LYNX_EXTERNAL_GLOBAL__")].lodash', } ``` -

If one external bundle contains multiple modules, should set the same library name to ensure it's loaded only once. For example:

+If one external bundle contains multiple modules, should set the same library name to ensure it's loaded only once. For example: + ```js ExternalsLoadingPlugin({ externals: { @@ -48,14 +147,16 @@ ExternalsLoadingPlugin({ } }) ``` -

Will generate the following webpack externals config:

+Will generate the following webpack externals config: + ```js externals: { lodash: 'lynx[Symbol.for("__LYNX_EXTERNAL_GLOBAL__")].Lodash', 'lodash-es': 'lynx[Symbol.for("__LYNX_EXTERNAL_GLOBAL__")].Lodash', } ``` -

You can pass an array to specify subpath of the external. Same as https://webpack.js.org/configuration/externals/\#string-1. For example:

+You can pass an array to specify subpath of the external. Same as https://webpack.js.org/configuration/externals/\#string-1. For example: + ```js ExternalsLoadingPlugin({ externals: { @@ -66,14 +167,74 @@ ExternalsLoadingPlugin({ } }) ``` -

Will generate the following webpack externals config:

+Will generate the following webpack externals config: + ```js externals: { preact: 'lynx[Symbol.for("__LYNX_EXTERNAL_GLOBAL__")].ReactLynx.Preact', } ``` - | -| [mainThread?](./externals-loading-webpack-plugin.externalvalue.mainthread.md) | | [LayerOptions](./externals-loading-webpack-plugin.layeroptions.md) | _(Optional)_ The options of the main-thread layer. | -| [timeout?](./externals-loading-webpack-plugin.externalvalue.timeout.md) | | number | _(Optional)_ The wait time in milliseconds. | -| [url](./externals-loading-webpack-plugin.externalvalue.url.md) | | string | The bundle(lynx.bundle) url of the library. The library source should be placed in customSections. | + + +
+ +[mainThread?](./externals-loading-webpack-plugin.externalvalue.mainthread.md) + + + + + + + +[LayerOptions](./externals-loading-webpack-plugin.layeroptions.md) + + + + +_(Optional)_ The options of the main-thread layer. + + +
+ +[timeout?](./externals-loading-webpack-plugin.externalvalue.timeout.md) + + + + + + + +number + + + + +_(Optional)_ The wait time in milliseconds. + + +
+ +[url?](./externals-loading-webpack-plugin.externalvalue.url.md) + + + + + + + +string + + + + +_(Optional)_ The final bundle URL to fetch directly at runtime. + +Use this when the external bundle is hosted outside the current build output, such as on a CDN. If both `url` and `bundlePath` are provided, `url` takes precedence because it is already the fully resolved address. + + +
diff --git a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.timeout.md b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.timeout.md index b8b7f8eb1..180c7b2a0 100644 --- a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.timeout.md +++ b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.timeout.md @@ -11,3 +11,8 @@ The wait time in milliseconds. ```typescript timeout?: number; ``` + +## Default Value + +`2000` + diff --git a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.url.md b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.url.md index 433d0dc9c..6e9149fac 100644 --- a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.url.md +++ b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.externalvalue.url.md @@ -4,10 +4,12 @@ ## ExternalValue.url property -The bundle(lynx.bundle) url of the library. The library source should be placed in `customSections`. +The final bundle URL to fetch directly at runtime. + +Use this when the external bundle is hosted outside the current build output, such as on a CDN. If both `url` and `bundlePath` are provided, `url` takes precedence because it is already the fully resolved address. **Signature:** ```typescript -url: string; +url?: string; ``` diff --git a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.layeroptions.md b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.layeroptions.md index cf66d5042..c7c662514 100644 --- a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.layeroptions.md +++ b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.layeroptions.md @@ -14,7 +14,45 @@ export interface LayerOptions ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [sectionPath](./externals-loading-webpack-plugin.layeroptions.sectionpath.md) | | string | The path in customSections. | + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[sectionPath](./externals-loading-webpack-plugin.layeroptions.sectionpath.md) + + + + + + + +string + + + + +The path in `customSections`. + + +
diff --git a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.md b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.md index d5698f240..7feab1634 100644 --- a/docs/zh/api/rspeedy/externals-loading-webpack-plugin.md +++ b/docs/zh/api/rspeedy/externals-loading-webpack-plugin.md @@ -12,15 +12,75 @@ Requires Lynx version 3.5 or later. ## Classes -| Class | Description | -| --- | --- | -| [ExternalsLoadingPlugin](./externals-loading-webpack-plugin.externalsloadingplugin.md) | The webpack plugin to load lynx external bundles. | + + +
+ +Class + + + + +Description + + +
+ +[ExternalsLoadingPlugin](./externals-loading-webpack-plugin.externalsloadingplugin.md) + + + + +The webpack plugin to load lynx external bundles. + + +
## Interfaces -| Interface | Description | -| --- | --- | -| [ExternalsLoadingPluginOptions](./externals-loading-webpack-plugin.externalsloadingpluginoptions.md) | The options of the ExternalsLoadingPlugin. | -| [ExternalValue](./externals-loading-webpack-plugin.externalvalue.md) | | -| [LayerOptions](./externals-loading-webpack-plugin.layeroptions.md) | The options of the background or main-thread layer. | + + + + +
+ +Interface + + + + +Description + + +
+ +[ExternalsLoadingPluginOptions](./externals-loading-webpack-plugin.externalsloadingpluginoptions.md) + + + + +The options of the `ExternalsLoadingPlugin`. + + +
+ +[ExternalValue](./externals-loading-webpack-plugin.externalvalue.md) + + + + +The value item of the externals. + + +
+ +[LayerOptions](./externals-loading-webpack-plugin.layeroptions.md) + + + + +The options of the background or main-thread layer. + + +
diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.builtinexternalspresetdefinitions.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.builtinexternalspresetdefinitions.md index 47c485a96..eb2d500e0 100644 --- a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.builtinexternalspresetdefinitions.md +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.builtinexternalspresetdefinitions.md @@ -9,5 +9,5 @@ Built-in externals preset definitions. **Signature:** ```typescript -export declare const builtInExternalsPresetDefinitions: ExternalsPresetDefinitions; +builtInExternalsPresetDefinitions: ExternalsPresetDefinitions ``` diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.defaultexternalbundlelibconfig.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.defaultexternalbundlelibconfig.md index 3b1bbfed7..5e0a90d99 100644 --- a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.defaultexternalbundlelibconfig.md +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.defaultexternalbundlelibconfig.md @@ -9,5 +9,5 @@ The default lib config for external bundle. **Signature:** ```typescript -export declare const defaultExternalBundleLibConfig: LibConfig; +DEFAULT_EXTERNAL_BUNDLE_LIB_CONFIG: LibConfig ``` diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.defineexternalbundlerslibconfig.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.defineexternalbundlerslibconfig.md index 925c63492..65c49467b 100644 --- a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.defineexternalbundlerslibconfig.md +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.defineexternalbundlerslibconfig.md @@ -4,7 +4,7 @@ ## defineExternalBundleRslibConfig() function -Get the Rslib config for building Lynx external bundles. +Get the rslib config for building Lynx external bundles. **Signature:** @@ -14,34 +14,118 @@ export declare function defineExternalBundleRslibConfig(userLibConfig: ExternalB ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| userLibConfig | [ExternalBundleLibConfig](./lynx-bundle-rslib-config.externalbundlelibconfig.md) | User-provided Rslib config. | -| encodeOptions | [EncodeOptions](./lynx-bundle-rslib-config.encodeoptions.md) | Optional encode options. | + + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +userLibConfig + + + + +[ExternalBundleLibConfig](./lynx-bundle-rslib-config.externalbundlelibconfig.md) + + + + + +
+ +encodeOptions + + + + +[EncodeOptions](./lynx-bundle-rslib-config.encodeoptions.md) + + + + +_(Optional)_ + + +
**Returns:** -`RslibConfig` +RslibConfig + +## Example 1 -## Example +If you want to build an external bundle which use in Lynx background thread, you can use the following code: -```ts +```js +// rslib.config.js import { defineExternalBundleRslibConfig } from '@lynx-js/lynx-bundle-rslib-config' -import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin' export default defineExternalBundleRslibConfig({ - id: 'comp-lib', + id: 'utils-lib', source: { entry: { - './App.js': './external-bundle/CompLib.tsx', - }, - }, - plugins: [pluginReactLynx()], - output: { - externalsPresets: { - reactlynx: true, + utils: { + import: './src/utils.ts', + layer: 'background', + } + } + } +}) +``` +Then you can use `lynx.loadScript('utils', { bundleName: 'utils-lib-bundle-url' })` in background thread. + +## Example 2 + +If you want to build an external bundle which use in Lynx main thread, you can use the following code: + +```js +// rslib.config.js +import { defineExternalBundleRslibConfig } from '@lynx-js/lynx-bundle-rslib-config' + +export default defineExternalBundleRslibConfig({ + id: 'utils-lib', + source: { + entry: { + utils: { + import: './src/utils.ts', + layer: 'main-thread', + } + } + } +}) +``` +Then you can use `lynx.loadScript('utils', { bundleName: 'utils-lib-bundle-url' })` in main-thread. + +## Example 3 + +If you want to build an external bundle which use both in Lynx main thread and background thread. You don't need to set the layer. + +```js +// rslib.config.js +import { defineExternalBundleRslibConfig } from '@lynx-js/lynx-bundle-rslib-config' + +export default defineExternalBundleRslibConfig({ + id: 'utils-lib', + source: { + entry: { + utils: './src/utils.ts', }, - globalObject: 'globalThis', - }, + } }) ``` +Then you can use `lynx.loadScript('utils', { bundleName: 'utils-lib-bundle-url' })` in background thread and `lynx.loadScript('utils__main-thread', { bundleName: 'utils-lib-bundle-url' })` in main-thread. + diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.encodeoptions.engineversion.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.encodeoptions.engineversion.md new file mode 100644 index 000000000..97f532489 --- /dev/null +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.encodeoptions.engineversion.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [@lynx-js/lynx-bundle-rslib-config](./lynx-bundle-rslib-config.md) > [EncodeOptions](./lynx-bundle-rslib-config.encodeoptions.md) > [engineVersion](./lynx-bundle-rslib-config.encodeoptions.engineversion.md) + +## EncodeOptions.engineVersion property + +The engine version of the external bundle. + +**Signature:** + +```typescript +engineVersion?: string; +``` + +## Default Value + +'3.5' + diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.encodeoptions.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.encodeoptions.md index e0fc59bdb..af321bccb 100644 --- a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.encodeoptions.md +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.encodeoptions.md @@ -4,16 +4,55 @@ ## EncodeOptions interface -Options for encoding the external bundle. +The options for encoding the external bundle. **Signature:** ```typescript -export interface EncodeOptions +export interface EncodeOptions ``` ## Properties -| Property | Type | Description | -| --- | --- | --- | -| `engineVersion?` | `string` | The engine version of the external bundle. | + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[engineVersion?](./lynx-bundle-rslib-config.encodeoptions.engineversion.md) + + + + + + + +string + + + + +_(Optional)_ The engine version of the external bundle. + + +
+ diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlelibconfig.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlelibconfig.md index 0ce8553a7..e2be1ab60 100644 --- a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlelibconfig.md +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlelibconfig.md @@ -4,16 +4,56 @@ ## ExternalBundleLibConfig interface -Rslib config shape accepted by `defineExternalBundleRslibConfig`. +Rslib config shape accepted by `defineExternalBundleRslibConfig`. **Signature:** ```typescript -export interface ExternalBundleLibConfig extends LibConfig +export interface ExternalBundleLibConfig extends LibConfig ``` +**Extends:** LibConfig ## Properties -| Property | Type | Description | -| --- | --- | --- | -| `output?` | [`OutputConfig`](./lynx-bundle-rslib-config.outputconfig.md) | Output config accepted by Lynx external bundle builds. | + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[output?](./lynx-bundle-rslib-config.externalbundlelibconfig.output.md) + + + + + + + +[OutputConfig](./lynx-bundle-rslib-config.outputconfig.md) + + + + +_(Optional)_ + + +
+ diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlelibconfig.output.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlelibconfig.output.md new file mode 100644 index 000000000..58aa29a66 --- /dev/null +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlelibconfig.output.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [@lynx-js/lynx-bundle-rslib-config](./lynx-bundle-rslib-config.md) > [ExternalBundleLibConfig](./lynx-bundle-rslib-config.externalbundlelibconfig.md) > [output](./lynx-bundle-rslib-config.externalbundlelibconfig.output.md) + +## ExternalBundleLibConfig.output property + +**Signature:** + +```typescript +output?: OutputConfig; +``` diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin._constructor_.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin._constructor_.md index 41120def6..8eb477c3e 100644 --- a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin._constructor_.md +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin._constructor_.md @@ -14,7 +14,35 @@ constructor(options: ExternalBundleWebpackPluginOptions); ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| options | [ExternalBundleWebpackPluginOptions](./lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.md) | | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +options + + + + +[ExternalBundleWebpackPluginOptions](./lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.md) + + + + + +
diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin.apply.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin.apply.md index d50f899e4..e144ffd91 100644 --- a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin.apply.md +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin.apply.md @@ -12,9 +12,37 @@ apply(compiler: Compiler): void; ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| compiler | Compiler | | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +compiler + + + + +Compiler + + + + + +
**Returns:** diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin.md index db5e1181c..7218e79e5 100644 --- a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin.md +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackplugin.md @@ -4,22 +4,77 @@ ## ExternalBundleWebpackPlugin class -Webpack plugin that builds and emits an external bundle. +The webpack plugin to build and emit the external bundle. **Signature:** ```typescript -export declare class ExternalBundleWebpackPlugin +export declare class ExternalBundleWebpackPlugin ``` ## Constructors -| Constructor | Description | -| --- | --- | -| `new ExternalBundleWebpackPlugin(options)` | Constructs a new instance of `ExternalBundleWebpackPlugin`. | + + +
+ +Constructor + + + + +Modifiers + + + + +Description + + +
+ +[(constructor)(options)](./lynx-bundle-rslib-config.externalbundlewebpackplugin._constructor_.md) + + + + + + + +Constructs a new instance of the `ExternalBundleWebpackPlugin` class + + +
## Methods -| Method | Return Type | Description | -| --- | --- | --- | -| `apply(compiler)` | `void` | Apply the plugin to the compiler. | + + +
+ +Method + + + + +Modifiers + + + + +Description + + +
+ +[apply(compiler)](./lynx-bundle-rslib-config.externalbundlewebpackplugin.apply.md) + + + + + + + + +
+ diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.engineversion.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.engineversion.md new file mode 100644 index 000000000..c0e93b533 --- /dev/null +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.engineversion.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [@lynx-js/lynx-bundle-rslib-config](./lynx-bundle-rslib-config.md) > [ExternalBundleWebpackPluginOptions](./lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.md) > [engineVersion](./lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.engineversion.md) + +## ExternalBundleWebpackPluginOptions.engineVersion property + +The engine version of the external bundle. + +**Signature:** + +```typescript +engineVersion?: string | undefined; +``` + +## Default Value + +'3.5' + diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.md index 1e12160bf..2a257afe6 100644 --- a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.md +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.md @@ -4,18 +4,93 @@ ## ExternalBundleWebpackPluginOptions interface -Options for `ExternalBundleWebpackPlugin`. +The options for [ExternalBundleWebpackPlugin](./lynx-bundle-rslib-config.externalbundlewebpackplugin.md). **Signature:** ```typescript -export interface ExternalBundleWebpackPluginOptions +export interface ExternalBundleWebpackPluginOptions ``` ## Properties -| Property | Type | Description | -| --- | --- | --- | -| `bundleFileName` | `string` | The external bundle filename. | -| `encode` | `(opts: unknown) => Promise<{ buffer: Buffer; }>` | Encode method exported from the Lynx encoder package. | -| `engineVersion?` | `string` | The target engine version of the external bundle. | + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[bundleFileName](./lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.bundlefilename.md) + + + + + + + +string + + + + +The external bundle filename. + + +
+ +[encode](./lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.encode.md) + + + + + + + +(opts: unknown) => Promise<{ buffer: Buffer; }> + + + + +The encode method which is exported from lynx-tasm package. + + +
+ +[engineVersion?](./lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.engineversion.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ The engine version of the external bundle. + + +
+ diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externals.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externals.md index 6725c2dc3..0fd7d73b8 100644 --- a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externals.md +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externals.md @@ -2,7 +2,7 @@ [Home](./index.md) > [@lynx-js/lynx-bundle-rslib-config](./lynx-bundle-rslib-config.md) > [Externals](./lynx-bundle-rslib-config.externals.md) -## Externals type alias +## Externals type External module to global-name mappings used when building Lynx external bundles. diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.extends.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.extends.md new file mode 100644 index 000000000..f9f5e2302 --- /dev/null +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.extends.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [@lynx-js/lynx-bundle-rslib-config](./lynx-bundle-rslib-config.md) > [ExternalsPresetDefinition](./lynx-bundle-rslib-config.externalspresetdefinition.md) > [extends](./lynx-bundle-rslib-config.externalspresetdefinition.extends.md) + +## ExternalsPresetDefinition.extends property + +Other preset names to include before applying the current preset. + +**Signature:** + +```typescript +extends?: string | string[]; +``` diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.externals.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.externals.md new file mode 100644 index 000000000..68939d05e --- /dev/null +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.externals.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [@lynx-js/lynx-bundle-rslib-config](./lynx-bundle-rslib-config.md) > [ExternalsPresetDefinition](./lynx-bundle-rslib-config.externalspresetdefinition.md) > [externals](./lynx-bundle-rslib-config.externalspresetdefinition.externals.md) + +## ExternalsPresetDefinition.externals property + +Externals contributed by this preset. + +**Signature:** + +```typescript +externals?: Externals; +``` diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.md index 16849726c..6be3e8c8f 100644 --- a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.md +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinition.md @@ -9,12 +9,69 @@ Definition for a named externals preset. **Signature:** ```typescript -export interface ExternalsPresetDefinition +export interface ExternalsPresetDefinition ``` ## Properties -| Property | Type | Description | -| --- | --- | --- | -| `extends?` | `string \| string[]` | Other preset names to include before applying the current preset. | -| `externals?` | [`Externals`](./lynx-bundle-rslib-config.externals.md) | Externals contributed by this preset. | + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[extends?](./lynx-bundle-rslib-config.externalspresetdefinition.extends.md) + + + + + + + +string \| string\[\] + + + + +_(Optional)_ Other preset names to include before applying the current preset. + + +
+ +[externals?](./lynx-bundle-rslib-config.externalspresetdefinition.externals.md) + + + + + + + +[Externals](./lynx-bundle-rslib-config.externals.md) + + + + +_(Optional)_ Externals contributed by this preset. + + +
+ diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinitions.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinitions.md index d4e6876de..2f4778cce 100644 --- a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinitions.md +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalspresetdefinitions.md @@ -2,7 +2,7 @@ [Home](./index.md) > [@lynx-js/lynx-bundle-rslib-config](./lynx-bundle-rslib-config.md) > [ExternalsPresetDefinitions](./lynx-bundle-rslib-config.externalspresetdefinitions.md) -## ExternalsPresetDefinitions type alias +## ExternalsPresetDefinitions type Available externals preset definitions. @@ -11,3 +11,5 @@ Available externals preset definitions. ```typescript export type ExternalsPresetDefinitions = Record; ``` +**References:** [ExternalsPresetDefinition](./lynx-bundle-rslib-config.externalspresetdefinition.md) + diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalspresets.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalspresets.md index 3a5ed3787..e3ea2c2c0 100644 --- a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalspresets.md +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.externalspresets.md @@ -2,14 +2,16 @@ [Home](./index.md) > [@lynx-js/lynx-bundle-rslib-config](./lynx-bundle-rslib-config.md) > [ExternalsPresets](./lynx-bundle-rslib-config.externalspresets.md) -## ExternalsPresets type alias +## ExternalsPresets type Enabled externals presets. +Preset names are resolved from the built-in preset definitions plus any custom definitions passed to [defineExternalBundleRslibConfig()](./lynx-bundle-rslib-config.defineexternalbundlerslibconfig.md). + **Signature:** ```typescript export type ExternalsPresets = { - reactlynx?: boolean; + reactlynx?: boolean; } & Record; ``` diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin._constructor_.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin._constructor_.md index 0837b86ba..7912f3d7c 100644 --- a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin._constructor_.md +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin._constructor_.md @@ -14,7 +14,37 @@ constructor(options?: Partial); ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| options | Partial<[MainThreadRuntimeWrapperWebpackPluginOptions](./lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.md)> | _(Optional)_ | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +options + + + + +Partial<[MainThreadRuntimeWrapperWebpackPluginOptions](./lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.md)> + + + + +_(Optional)_ + + +
diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.apply.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.apply.md index 90a2c5a92..99ba71f0a 100644 --- a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.apply.md +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.apply.md @@ -12,9 +12,37 @@ apply(compiler: Compiler): void; ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| compiler | Compiler | | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +compiler + + + + +Compiler + + + + + +
**Returns:** diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.md index 5ec8ed50c..095450c06 100644 --- a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.md +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.md @@ -4,22 +4,77 @@ ## MainThreadRuntimeWrapperWebpackPlugin class -Webpack plugin that wraps main-thread runtime modules for external bundles. +The main-thread runtime wrapper for external bundle. **Signature:** ```typescript -export declare class MainThreadRuntimeWrapperWebpackPlugin +export declare class MainThreadRuntimeWrapperWebpackPlugin ``` ## Constructors -| Constructor | Description | -| --- | --- | -| `new MainThreadRuntimeWrapperWebpackPlugin(options?)` | Constructs a new instance of `MainThreadRuntimeWrapperWebpackPlugin`. | + + +
+ +Constructor + + + + +Modifiers + + + + +Description + + +
+ +[(constructor)(options)](./lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin._constructor_.md) + + + + + + + +Constructs a new instance of the `MainThreadRuntimeWrapperWebpackPlugin` class + + +
## Methods -| Method | Return Type | Description | -| --- | --- | --- | -| `apply(compiler)` | `void` | Apply the plugin to the compiler. | + + +
+ +Method + + + + +Modifiers + + + + +Description + + +
+ +[apply(compiler)](./lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.apply.md) + + + + + + + + +
+ diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.md index e0767cf82..3ad499b62 100644 --- a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.md +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.md @@ -4,16 +4,55 @@ ## MainThreadRuntimeWrapperWebpackPluginOptions interface -Options for `MainThreadRuntimeWrapperWebpackPlugin`. +The options of [MainThreadRuntimeWrapperWebpackPlugin](./lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.md). **Signature:** ```typescript -export interface MainThreadRuntimeWrapperWebpackPluginOptions +export interface MainThreadRuntimeWrapperWebpackPluginOptions ``` ## Properties -| Property | Type | Description | -| --- | --- | --- | -| `test` | `BannerPlugin['options']['test']` | Include all modules that pass the test assertion. | + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[test](./lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.test.md) + + + + + + + +BannerPlugin\['options'\]\['test'\] + + + + +Include all modules that pass test assertion. + + +
+ diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.test.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.test.md index 42a4bc2d7..4f04a37ca 100644 --- a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.test.md +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.test.md @@ -11,3 +11,8 @@ Include all modules that pass test assertion. ```typescript test: BannerPlugin['options']['test']; ``` + +## Default Value + +`/\.js$/` + diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.md index 1705c30ec..12b5aac77 100644 --- a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.md +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.md @@ -4,44 +4,247 @@ ## lynx-bundle-rslib-config package -`@lynx-js/lynx-bundle-rslib-config` is the package that provides the configurations for bundling Lynx bundle with [Rslib](https://rslib.rs/). +`@lynx-js/lynx-bundle-rslib-config` is the package that provides the configurations for bundling Lynx bundle with [Rslib](https://rslib.rs/). ## Classes -| Class | Description | -| --- | --- | -| [ExternalBundleWebpackPlugin](./lynx-bundle-rslib-config.externalbundlewebpackplugin.md) | Webpack plugin that builds and emits an external bundle. | -| [MainThreadRuntimeWrapperWebpackPlugin](./lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.md) | Webpack plugin that wraps main-thread runtime modules for external bundles. | + + + +
+ +Class + + + + +Description + + +
+ +[ExternalBundleWebpackPlugin](./lynx-bundle-rslib-config.externalbundlewebpackplugin.md) + + + + +The webpack plugin to build and emit the external bundle. + + +
+ +[MainThreadRuntimeWrapperWebpackPlugin](./lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.md) + + + + +The main-thread runtime wrapper for external bundle. + + +
## Functions -| Function | Description | -| --- | --- | -| [defineExternalBundleRslibConfig(userLibConfig, encodeOptions)](./lynx-bundle-rslib-config.defineexternalbundlerslibconfig.md) | Get the Rslib config for building Lynx external bundles. | + + +
+ +Function + + + + +Description + + +
+ +[defineExternalBundleRslibConfig(userLibConfig, encodeOptions)](./lynx-bundle-rslib-config.defineexternalbundlerslibconfig.md) + + + + +Get the rslib config for building Lynx external bundles. + + +
## Interfaces -| Interface | Description | -| --- | --- | -| [EncodeOptions](./lynx-bundle-rslib-config.encodeoptions.md) | Options for encoding the external bundle. | -| [ExternalBundleLibConfig](./lynx-bundle-rslib-config.externalbundlelibconfig.md) | Rslib config shape accepted by `defineExternalBundleRslibConfig`. | -| [ExternalBundleWebpackPluginOptions](./lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.md) | Options for `ExternalBundleWebpackPlugin`. | -| [ExternalsPresetDefinition](./lynx-bundle-rslib-config.externalspresetdefinition.md) | Definition for a named externals preset. | -| [MainThreadRuntimeWrapperWebpackPluginOptions](./lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.md) | Options for `MainThreadRuntimeWrapperWebpackPlugin`. | + + + + + + +
+ +Interface + + + + +Description + + +
+ +[EncodeOptions](./lynx-bundle-rslib-config.encodeoptions.md) + + + + +The options for encoding the external bundle. + + +
+ +[ExternalBundleLibConfig](./lynx-bundle-rslib-config.externalbundlelibconfig.md) + + + + +Rslib config shape accepted by `defineExternalBundleRslibConfig`. + + +
+ +[ExternalBundleWebpackPluginOptions](./lynx-bundle-rslib-config.externalbundlewebpackpluginoptions.md) + + + + +The options for [ExternalBundleWebpackPlugin](./lynx-bundle-rslib-config.externalbundlewebpackplugin.md). + + +
+ +[ExternalsPresetDefinition](./lynx-bundle-rslib-config.externalspresetdefinition.md) + + + + +Definition for a named externals preset. + + +
+ +[MainThreadRuntimeWrapperWebpackPluginOptions](./lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackpluginoptions.md) -## Type Aliases -| Type Alias | Description | -| --- | --- | -| [Externals](./lynx-bundle-rslib-config.externals.md) | External module to global-name mappings used when building Lynx external bundles. | -| [ExternalsPresetDefinitions](./lynx-bundle-rslib-config.externalspresetdefinitions.md) | Available externals preset definitions. | -| [ExternalsPresets](./lynx-bundle-rslib-config.externalspresets.md) | Enabled externals presets. | -| [OutputConfig](./lynx-bundle-rslib-config.outputconfig.md) | Output config accepted by Lynx external bundle builds. | + + +The options of [MainThreadRuntimeWrapperWebpackPlugin](./lynx-bundle-rslib-config.mainthreadruntimewrapperwebpackplugin.md). + + +
## Variables -| Variable | Description | -| --- | --- | -| [builtInExternalsPresetDefinitions](./lynx-bundle-rslib-config.builtinexternalspresetdefinitions.md) | Built-in externals preset definitions. | -| [defaultExternalBundleLibConfig](./lynx-bundle-rslib-config.defaultexternalbundlelibconfig.md) | The default lib config for external bundle. | -| [reactLynxExternalsPreset](./lynx-bundle-rslib-config.reactlynxexternalspreset.md) | Standard ReactLynx external mappings used by the built-in `reactlynx` preset. | + + + + +
+ +Variable + + + + +Description + + +
+ +[builtInExternalsPresetDefinitions](./lynx-bundle-rslib-config.builtinexternalspresetdefinitions.md) + + + + +Built-in externals preset definitions. + + +
+ +[defaultExternalBundleLibConfig](./lynx-bundle-rslib-config.defaultexternalbundlelibconfig.md) + + + + +The default lib config for external bundle. + + +
+ +[reactLynxExternalsPreset](./lynx-bundle-rslib-config.reactlynxexternalspreset.md) + + + + +Standard ReactLynx external mappings used by the built-in `reactlynx` preset. + + +
+ +## Type Aliases + + + + + + +
+ +Type Alias + + + + +Description + + +
+ +[Externals](./lynx-bundle-rslib-config.externals.md) + + + + +External module to global-name mappings used when building Lynx external bundles. + + +
+ +[ExternalsPresetDefinitions](./lynx-bundle-rslib-config.externalspresetdefinitions.md) + + + + +Available externals preset definitions. + + +
+ +[ExternalsPresets](./lynx-bundle-rslib-config.externalspresets.md) + + + + +Enabled externals presets. + +Preset names are resolved from the built-in preset definitions plus any custom definitions passed to [defineExternalBundleRslibConfig()](./lynx-bundle-rslib-config.defineexternalbundlerslibconfig.md). + + +
+ +[OutputConfig](./lynx-bundle-rslib-config.outputconfig.md) + + + + +Output config accepted by Lynx external bundle builds. + + +
+ diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.outputconfig.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.outputconfig.md index 35b74a59b..2df9e5683 100644 --- a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.outputconfig.md +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.outputconfig.md @@ -2,7 +2,7 @@ [Home](./index.md) > [@lynx-js/lynx-bundle-rslib-config](./lynx-bundle-rslib-config.md) > [OutputConfig](./lynx-bundle-rslib-config.outputconfig.md) -## OutputConfig type alias +## OutputConfig type Output config accepted by Lynx external bundle builds. @@ -10,18 +10,11 @@ Output config accepted by Lynx external bundle builds. ```typescript export type OutputConfig = Required['output'] & { - externalsPresets?: ExternalsPresets; - externalsPresetDefinitions?: ExternalsPresetDefinitions; - externals?: Externals; - globalObject?: 'lynx' | 'globalThis'; + externalsPresets?: ExternalsPresets; + externalsPresetDefinitions?: ExternalsPresetDefinitions; + externals?: Externals; + globalObject?: 'lynx' | 'globalThis'; }; ``` +**References:** [ExternalsPresets](./lynx-bundle-rslib-config.externalspresets.md), [ExternalsPresetDefinitions](./lynx-bundle-rslib-config.externalspresetdefinitions.md), [Externals](./lynx-bundle-rslib-config.externals.md) -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| `externals?` | [`Externals`](./lynx-bundle-rslib-config.externals.md) | Explicit external module mappings. | -| `externalsPresetDefinitions?` | [`ExternalsPresetDefinitions`](./lynx-bundle-rslib-config.externalspresetdefinitions.md) | Definitions for custom presets enabled by `externalsPresets`. | -| `externalsPresets?` | [`ExternalsPresets`](./lynx-bundle-rslib-config.externalspresets.md) | Presets for external libraries. | -| `globalObject?` | `'lynx' \| 'globalThis'` | Global object used to mount the built library. | diff --git a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.reactlynxexternalspreset.md b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.reactlynxexternalspreset.md index 04f5099eb..f4b93f08d 100644 --- a/docs/zh/api/rspeedy/lynx-bundle-rslib-config.reactlynxexternalspreset.md +++ b/docs/zh/api/rspeedy/lynx-bundle-rslib-config.reactlynxexternalspreset.md @@ -9,5 +9,5 @@ Standard ReactLynx external mappings used by the built-in `reactlynx` preset. **Signature:** ```typescript -export declare const reactLynxExternalsPreset: Externals; +reactLynxExternalsPreset: Externals ``` diff --git a/docs/zh/api/rspeedy/qrcode-rsbuild-plugin.md b/docs/zh/api/rspeedy/qrcode-rsbuild-plugin.md index de2fb329b..19e06955e 100644 --- a/docs/zh/api/rspeedy/qrcode-rsbuild-plugin.md +++ b/docs/zh/api/rspeedy/qrcode-rsbuild-plugin.md @@ -8,19 +8,79 @@ A rsbuild plugin that print the template.js url using QRCode. ## Functions -| Function | Description | -| --- | --- | -| [pluginQRCode(options)](./qrcode-rsbuild-plugin.pluginqrcode.md) | Create a rsbuild plugin for printing QRCode. | + + +
+ +Function + + + + +Description + + +
+ +[pluginQRCode(options)](./qrcode-rsbuild-plugin.pluginqrcode.md) + + + + +Create a rsbuild plugin for printing QRCode. + + +
## Interfaces -| Interface | Description | -| --- | --- | -| [PluginQRCodeOptions](./qrcode-rsbuild-plugin.pluginqrcodeoptions.md) | The options for [pluginQRCode()](./qrcode-rsbuild-plugin.pluginqrcode.md). | + + +
+ +Interface + + + + +Description + + +
+ +[PluginQRCodeOptions](./qrcode-rsbuild-plugin.pluginqrcodeoptions.md) + + + + +The options for [pluginQRCode()](./qrcode-rsbuild-plugin.pluginqrcode.md). + + +
## Type Aliases -| Type Alias | Description | -| --- | --- | -| [CustomizedSchemaFn](./qrcode-rsbuild-plugin.customizedschemafn.md) | Customize the generated schema. | + + +
+ +Type Alias + + + + +Description + + +
+ +[CustomizedSchemaFn](./qrcode-rsbuild-plugin.customizedschemafn.md) + + + + +Customize the generated schema. + + +
diff --git a/docs/zh/api/rspeedy/qrcode-rsbuild-plugin.pluginqrcode.md b/docs/zh/api/rspeedy/qrcode-rsbuild-plugin.pluginqrcode.md index 7aefd97d5..46d226bee 100644 --- a/docs/zh/api/rspeedy/qrcode-rsbuild-plugin.pluginqrcode.md +++ b/docs/zh/api/rspeedy/qrcode-rsbuild-plugin.pluginqrcode.md @@ -14,9 +14,39 @@ export declare function pluginQRCode(options?: PluginQRCodeOptions): RsbuildPlug ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| options | [PluginQRCodeOptions](./qrcode-rsbuild-plugin.pluginqrcodeoptions.md) | _(Optional)_ | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +options + + + + +[PluginQRCodeOptions](./qrcode-rsbuild-plugin.pluginqrcodeoptions.md) + + + + +_(Optional)_ + + +
**Returns:** diff --git a/docs/zh/api/rspeedy/qrcode-rsbuild-plugin.pluginqrcodeoptions.md b/docs/zh/api/rspeedy/qrcode-rsbuild-plugin.pluginqrcodeoptions.md index 702051096..d15fa9ef0 100644 --- a/docs/zh/api/rspeedy/qrcode-rsbuild-plugin.pluginqrcodeoptions.md +++ b/docs/zh/api/rspeedy/qrcode-rsbuild-plugin.pluginqrcodeoptions.md @@ -14,7 +14,45 @@ export interface PluginQRCodeOptions ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [schema?](./qrcode-rsbuild-plugin.pluginqrcodeoptions.schema.md) | | [CustomizedSchemaFn](./qrcode-rsbuild-plugin.customizedschemafn.md) \| undefined | _(Optional)_ Customize the generated schema. | + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[schema?](./qrcode-rsbuild-plugin.pluginqrcodeoptions.schema.md) + + + + + + + +[CustomizedSchemaFn](./qrcode-rsbuild-plugin.customizedschemafn.md) \| undefined + + + + +_(Optional)_ Customize the generated schema. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.buildcache.cachedigest.md b/docs/zh/api/rspeedy/rspeedy.buildcache.cachedigest.md index d0213b8a6..7b909e178 100644 --- a/docs/zh/api/rspeedy/rspeedy.buildcache.cachedigest.md +++ b/docs/zh/api/rspeedy/rspeedy.buildcache.cachedigest.md @@ -15,6 +15,10 @@ Add additional cache digests, the previous build cache will be invalidated when cacheDigest?: Array | undefined; ``` +## Default Value + +undefined + ## Example Add `process.env.SOME_ENV` to the cache digest. diff --git a/docs/zh/api/rspeedy/rspeedy.buildcache.cachedirectory.md b/docs/zh/api/rspeedy/rspeedy.buildcache.cachedirectory.md index b90764d90..d5a2fa863 100644 --- a/docs/zh/api/rspeedy/rspeedy.buildcache.cachedirectory.md +++ b/docs/zh/api/rspeedy/rspeedy.buildcache.cachedirectory.md @@ -14,3 +14,8 @@ The output directory of the cache files. ```typescript cacheDirectory?: string | undefined; ``` + +## Default Value + +'node\_modules/.cache' + diff --git a/docs/zh/api/rspeedy/rspeedy.buildcache.md b/docs/zh/api/rspeedy/rspeedy.buildcache.md index 655115d75..3022c0de5 100644 --- a/docs/zh/api/rspeedy/rspeedy.buildcache.md +++ b/docs/zh/api/rspeedy/rspeedy.buildcache.md @@ -19,9 +19,83 @@ export interface BuildCache ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [buildDependencies?](./rspeedy.buildcache.builddependencies.md) | | string\[\] \| undefined | **_(BETA)_** _(Optional)_ An array of files containing build dependencies. Rspack will use the hash of each of these files to invalidate the persistent cache. | -| [cacheDigest?](./rspeedy.buildcache.cachedigest.md) | | Array<string \| undefined> \| undefined | **_(BETA)_** _(Optional)_ Add additional cache digests, the previous build cache will be invalidated when any value in the array changes. | -| [cacheDirectory?](./rspeedy.buildcache.cachedirectory.md) | | string \| undefined | **_(BETA)_** _(Optional)_ The output directory of the cache files. | + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[buildDependencies?](./rspeedy.buildcache.builddependencies.md) + + + + + + + +string\[\] \| undefined + + + + +**_(BETA)_** _(Optional)_ An array of files containing build dependencies. Rspack will use the hash of each of these files to invalidate the persistent cache. + + +
+ +[cacheDigest?](./rspeedy.buildcache.cachedigest.md) + + + + + + + +Array<string \| undefined> \| undefined + + + + +**_(BETA)_** _(Optional)_ Add additional cache digests, the previous build cache will be invalidated when any value in the array changes. + + +
+ +[cacheDirectory?](./rspeedy.buildcache.cachedirectory.md) + + + + + + + +string \| undefined + + + + +**_(BETA)_** _(Optional)_ The output directory of the cache files. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.chunksplit.md b/docs/zh/api/rspeedy/rspeedy.chunksplit.md index 5f208c134..dd4097948 100644 --- a/docs/zh/api/rspeedy/rspeedy.chunksplit.md +++ b/docs/zh/api/rspeedy/rspeedy.chunksplit.md @@ -14,8 +14,64 @@ export interface ChunkSplit ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [override?](./rspeedy.chunksplit.override.md) | | Rspack.Configuration extends { optimization?: { splitChunks?: infer P; } \| undefined; } ? P : never | _(Optional)_ Custom Rspack chunk splitting config can be specified. | -| [strategy?](./rspeedy.chunksplit.strategy.md) | | 'all-in-one' \| 'split-by-module' \| 'split-by-experience' \| 'single-vendor' \| undefined | _(Optional)_ The ChunkSplitting strategy. | + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[override?](./rspeedy.chunksplit.override.md) + + + + + + + +Rspack.Configuration extends { optimization?: { splitChunks?: infer P; } \| undefined; } ? P : never + + + + +_(Optional)_ Custom Rspack chunk splitting config can be specified. + + +
+ +[strategy?](./rspeedy.chunksplit.strategy.md) + + + + + + + +'all-in-one' \| 'split-by-module' \| 'split-by-experience' \| 'single-vendor' \| undefined + + + + +_(Optional)_ The ChunkSplitting strategy. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.chunksplitbysize.md b/docs/zh/api/rspeedy/rspeedy.chunksplitbysize.md index 075a55246..4081b3a46 100644 --- a/docs/zh/api/rspeedy/rspeedy.chunksplitbysize.md +++ b/docs/zh/api/rspeedy/rspeedy.chunksplitbysize.md @@ -14,10 +14,102 @@ export interface ChunkSplitBySize ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [maxSize?](./rspeedy.chunksplitbysize.maxsize.md) | | number \| undefined | _(Optional)_ The maximum size of a chunk, unit in bytes. Defaults to Number.POSITIVE_INFINITY. | -| [minSize?](./rspeedy.chunksplitbysize.minsize.md) | | number \| undefined | _(Optional)_ The minimum size of a chunk, unit in bytes. Defaults to 10000. | -| [override?](./rspeedy.chunksplitbysize.override.md) | | Rspack.Configuration extends { optimization?: { splitChunks?: infer P; } \| undefined; } ? P : never | _(Optional)_ Custom Rspack chunk splitting config can be specified. | -| [strategy](./rspeedy.chunksplitbysize.strategy.md) | | 'split-by-size' | The ChunkSplitting strategy. | + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[maxSize?](./rspeedy.chunksplitbysize.maxsize.md) + + + + + + + +number \| undefined + + + + +_(Optional)_ The maximum size of a chunk, unit in bytes. Defaults to `Number.POSITIVE_INFINITY`. + + +
+ +[minSize?](./rspeedy.chunksplitbysize.minsize.md) + + + + + + + +number \| undefined + + + + +_(Optional)_ The minimum size of a chunk, unit in bytes. Defaults to `10000`. + + +
+ +[override?](./rspeedy.chunksplitbysize.override.md) + + + + + + + +Rspack.Configuration extends { optimization?: { splitChunks?: infer P; } \| undefined; } ? P : never + + + + +_(Optional)_ Custom Rspack chunk splitting config can be specified. + + +
+ +[strategy](./rspeedy.chunksplitbysize.strategy.md) + + + + + + + +'split-by-size' + + + + +The ChunkSplitting strategy. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.chunksplitcustom.md b/docs/zh/api/rspeedy/rspeedy.chunksplitcustom.md index f6b53e620..b07c66893 100644 --- a/docs/zh/api/rspeedy/rspeedy.chunksplitcustom.md +++ b/docs/zh/api/rspeedy/rspeedy.chunksplitcustom.md @@ -14,8 +14,64 @@ export interface ChunkSplitCustom ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [splitChunks?](./rspeedy.chunksplitcustom.splitchunks.md) | | Rspack.Configuration extends { optimization?: { splitChunks?: infer P; } \| undefined; } ? P : never | _(Optional)_ Custom Rspack chunk splitting config can be specified. | -| [strategy](./rspeedy.chunksplitcustom.strategy.md) | | 'custom' | The ChunkSplitting strategy. | + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[splitChunks?](./rspeedy.chunksplitcustom.splitchunks.md) + + + + + + + +Rspack.Configuration extends { optimization?: { splitChunks?: infer P; } \| undefined; } ? P : never + + + + +_(Optional)_ Custom Rspack chunk splitting config can be specified. + + +
+ +[strategy](./rspeedy.chunksplitcustom.strategy.md) + + + + + + + +'custom' + + + + +The ChunkSplitting strategy. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.config.md b/docs/zh/api/rspeedy/rspeedy.config.md index 0bb667fb3..6d3ad98d8 100644 --- a/docs/zh/api/rspeedy/rspeedy.config.md +++ b/docs/zh/api/rspeedy/rspeedy.config.md @@ -14,16 +14,216 @@ export interface Config ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [dev?](./rspeedy.config.dev.md) | | [Dev](./rspeedy.dev.md) \| undefined | _(Optional)_ The [Dev](./rspeedy.dev.md) option is used to control the behavior related with development. Including: HMR, DevServer, etc. | -| [environments?](./rspeedy.config.environments.md) | | RsbuildConfig\['environments'\] \| undefined | _(Optional)_ The [Config.environments](./rspeedy.config.environments.md) option is used to set the output environment. | -| [mode?](./rspeedy.config.mode.md) | | 'development' \| 'production' \| 'none' \| undefined | _(Optional)_ Specify the build mode for Rsbuild and Rspack, as each mode has different default behavior and optimizations. | -| [output?](./rspeedy.config.output.md) | | [Output](./rspeedy.output.md) \| undefined | _(Optional)_ The [Output](./rspeedy.output.md) option is used to set how and where should the bundles and assets output. | -| [performance?](./rspeedy.config.performance.md) | | [Performance](./rspeedy.performance.md) \| undefined | _(Optional)_ The [Performance](./rspeedy.performance.md) option is used to optimize the build-time and runtime performance. | -| [plugins?](./rspeedy.config.plugins.md) | | RsbuildPlugins \| undefined | _(Optional)_ The plugins option is used to customize the build process in a variety of ways. | -| [resolve?](./rspeedy.config.resolve.md) | | [Resolve](./rspeedy.resolve.md) \| undefined | _(Optional)_ The [Resolve](./rspeedy.resolve.md) option is used to control the resolution behavior of Rspack. | -| [server?](./rspeedy.config.server.md) | | [Server](./rspeedy.server.md) \| undefined | _(Optional)_ The [Server](./rspeedy.server.md) option changes the behavior of dev-server. | -| [source?](./rspeedy.config.source.md) | | [Source](./rspeedy.source.md) \| undefined | _(Optional)_ The [Source](./rspeedy.source.md) option changes the behavior of source files. | -| [tools?](./rspeedy.config.tools.md) | | [Tools](./rspeedy.tools.md) \| undefined | _(Optional)_ The [Tools](./rspeedy.tools.md) options changes the behavior of various building tools. | + + + + + + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[dev?](./rspeedy.config.dev.md) + + + + + + + +[Dev](./rspeedy.dev.md) \| undefined + + + + +_(Optional)_ The [Dev](./rspeedy.dev.md) option is used to control the behavior related with development. Including: HMR, DevServer, etc. + + +
+ +[environments?](./rspeedy.config.environments.md) + + + + + + + +RsbuildConfig\['environments'\] \| undefined + + + + +_(Optional)_ The [Config.environments](./rspeedy.config.environments.md) option is used to set the output environment. + + +
+ +[mode?](./rspeedy.config.mode.md) + + + + + + + +'development' \| 'production' \| 'none' \| undefined + + + + +_(Optional)_ Specify the build mode for Rsbuild and Rspack, as each mode has different default behavior and optimizations. + + +
+ +[output?](./rspeedy.config.output.md) + + + + + + + +[Output](./rspeedy.output.md) \| undefined + + + + +_(Optional)_ The [Output](./rspeedy.output.md) option is used to set how and where should the bundles and assets output. + + +
+ +[performance?](./rspeedy.config.performance.md) + + + + + + + +[Performance](./rspeedy.performance.md) \| undefined + + + + +_(Optional)_ The [Performance](./rspeedy.performance.md) option is used to optimize the build-time and runtime performance. + + +
+ +[plugins?](./rspeedy.config.plugins.md) + + + + + + + +RsbuildPlugins \| undefined + + + + +_(Optional)_ The `plugins` option is used to customize the build process in a variety of ways. + + +
+ +[resolve?](./rspeedy.config.resolve.md) + + + + + + + +[Resolve](./rspeedy.resolve.md) \| undefined + + + + +_(Optional)_ The [Resolve](./rspeedy.resolve.md) option is used to control the resolution behavior of Rspack. + + +
+ +[server?](./rspeedy.config.server.md) + + + + + + + +[Server](./rspeedy.server.md) \| undefined + + + + +_(Optional)_ The [Server](./rspeedy.server.md) option changes the behavior of dev-server. + + +
+ +[source?](./rspeedy.config.source.md) + + + + + + + +[Source](./rspeedy.source.md) \| undefined + + + + +_(Optional)_ The [Source](./rspeedy.source.md) option changes the behavior of source files. + + +
+ +[tools?](./rspeedy.config.tools.md) + + + + + + + +[Tools](./rspeedy.tools.md) \| undefined + + + + +_(Optional)_ The [Tools](./rspeedy.tools.md) options changes the behavior of various building tools. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.configparams.md b/docs/zh/api/rspeedy/rspeedy.configparams.md index 424206287..44a4864d1 100644 --- a/docs/zh/api/rspeedy/rspeedy.configparams.md +++ b/docs/zh/api/rspeedy/rspeedy.configparams.md @@ -14,8 +14,64 @@ export interface ConfigParams ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [command](./rspeedy.configparams.command.md) | | 'build' \| 'dev' \| 'inspect' \| 'preview' \| (string & Record<never, never>) | The CLI command of Rspeedy. | -| [env](./rspeedy.configparams.env.md) | | 'production' \| 'development' \| 'test' \| (string & Record<never, never>) | The value of process.env['NODE_ENV'] | + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[command](./rspeedy.configparams.command.md) + + + + + + + +'build' \| 'dev' \| 'inspect' \| 'preview' \| (string & Record<never, never>) + + + + +The CLI command of Rspeedy. + + +
+ +[env](./rspeedy.configparams.env.md) + + + + + + + +'production' \| 'development' \| 'test' \| (string & Record<never, never>) + + + + +The value of `process.env['NODE_ENV']` + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.createrspeedy.md b/docs/zh/api/rspeedy/rspeedy.createrspeedy.md index a67096af2..3b9941624 100644 --- a/docs/zh/api/rspeedy/rspeedy.createrspeedy.md +++ b/docs/zh/api/rspeedy/rspeedy.createrspeedy.md @@ -9,14 +9,56 @@ The `createRspeedy` method can let you create a Rspeedy instance and you can cus **Signature:** ```typescript -export declare function createRspeedy({ cwd, rspeedyConfig, loadEnv, environment, callerName, }: CreateRspeedyOptions): Promise; +export declare function createRspeedy(input: CreateRspeedyOptions): Promise; ``` ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| { cwd, rspeedyConfig, loadEnv, environment, callerName, } | [CreateRspeedyOptions](./rspeedy.createrspeedyoptions.md) | | + + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +{ cwd, rspeedyConfig, loadEnv, environment, callerName, } + + + + +(not declared) + + + + + +
+ +input + + + + +[CreateRspeedyOptions](./rspeedy.createrspeedyoptions.md) + + + + + +
**Returns:** diff --git a/docs/zh/api/rspeedy/rspeedy.createrspeedyoptions.callername.md b/docs/zh/api/rspeedy/rspeedy.createrspeedyoptions.callername.md index 8d3ab00e5..6b63e2575 100644 --- a/docs/zh/api/rspeedy/rspeedy.createrspeedyoptions.callername.md +++ b/docs/zh/api/rspeedy/rspeedy.createrspeedyoptions.callername.md @@ -12,6 +12,10 @@ The name of the framework or tool that is currently invoking Rsbuild. This allow callerName?: string; ``` +## Default Value + +'rspeedy' + ## Example Rsbuild plugins can access this value via `api.context.callerName`. diff --git a/docs/zh/api/rspeedy/rspeedy.createrspeedyoptions.environment.md b/docs/zh/api/rspeedy/rspeedy.createrspeedyoptions.environment.md index 48794956a..a35e56fd9 100644 --- a/docs/zh/api/rspeedy/rspeedy.createrspeedyoptions.environment.md +++ b/docs/zh/api/rspeedy/rspeedy.createrspeedyoptions.environment.md @@ -11,3 +11,8 @@ Only build specified environments. For example, passing `['lynx']` will only bui ```typescript environment?: CreateRsbuildOptions['environment']; ``` + +## Default Value + +\[\] + diff --git a/docs/zh/api/rspeedy/rspeedy.createrspeedyoptions.loadenv.md b/docs/zh/api/rspeedy/rspeedy.createrspeedyoptions.loadenv.md index e324196cc..46f57f398 100644 --- a/docs/zh/api/rspeedy/rspeedy.createrspeedyoptions.loadenv.md +++ b/docs/zh/api/rspeedy/rspeedy.createrspeedyoptions.loadenv.md @@ -11,3 +11,8 @@ Rspeedy automatically loads the .env file by default, utilizing the \[Rsbuild AP ```typescript loadEnv?: CreateRsbuildOptions['loadEnv']; ``` + +## Default Value + +true + diff --git a/docs/zh/api/rspeedy/rspeedy.createrspeedyoptions.md b/docs/zh/api/rspeedy/rspeedy.createrspeedyoptions.md index e6b53be27..5260bccd4 100644 --- a/docs/zh/api/rspeedy/rspeedy.createrspeedyoptions.md +++ b/docs/zh/api/rspeedy/rspeedy.createrspeedyoptions.md @@ -14,11 +14,121 @@ export interface CreateRspeedyOptions ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [callerName?](./rspeedy.createrspeedyoptions.callername.md) | | string | _(Optional)_ The name of the framework or tool that is currently invoking Rsbuild. This allows plugins to tailor their behavior based on the calling context. | -| [cwd?](./rspeedy.createrspeedyoptions.cwd.md) | | string | _(Optional)_ The root path of the current build. | -| [environment?](./rspeedy.createrspeedyoptions.environment.md) | | CreateRsbuildOptions\['environment'\] | _(Optional)_ Only build specified environments. For example, passing ['lynx'] will only build the lynx environment. If not specified or passing an empty array, all environments will be built. | -| [loadEnv?](./rspeedy.createrspeedyoptions.loadenv.md) | | CreateRsbuildOptions\['loadEnv'\] | _(Optional)_ Rspeedy automatically loads the .env file by default, utilizing the \[Rsbuild API\](https://rsbuild.dev/api/javascript-api/core\#load-env-variables). 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. | -| [rspeedyConfig?](./rspeedy.createrspeedyoptions.rspeedyconfig.md) | | [Config](./rspeedy.config.md) | _(Optional)_ The config of Rspeedy. | + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[callerName?](./rspeedy.createrspeedyoptions.callername.md) + + + + + + + +string + + + + +_(Optional)_ The name of the framework or tool that is currently invoking Rsbuild. This allows plugins to tailor their behavior based on the calling context. + + +
+ +[cwd?](./rspeedy.createrspeedyoptions.cwd.md) + + + + + + + +string + + + + +_(Optional)_ The root path of the current build. + + +
+ +[environment?](./rspeedy.createrspeedyoptions.environment.md) + + + + + + + +CreateRsbuildOptions\['environment'\] + + + + +_(Optional)_ Only build specified environments. For example, passing `['lynx']` will only build the `lynx` environment. If not specified or passing an empty array, all environments will be built. + + +
+ +[loadEnv?](./rspeedy.createrspeedyoptions.loadenv.md) + + + + + + + +CreateRsbuildOptions\['loadEnv'\] + + + + +_(Optional)_ Rspeedy automatically loads the .env file by default, utilizing the \[Rsbuild API\](https://rsbuild.dev/api/javascript-api/core\#load-env-variables). 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`. + + +
+ +[rspeedyConfig?](./rspeedy.createrspeedyoptions.rspeedyconfig.md) + + + + + + + +[Config](./rspeedy.config.md) + + + + +_(Optional)_ The config of Rspeedy. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.cssextract.md b/docs/zh/api/rspeedy/rspeedy.cssextract.md index 599b9c94a..549e8102b 100644 --- a/docs/zh/api/rspeedy/rspeedy.cssextract.md +++ b/docs/zh/api/rspeedy/rspeedy.cssextract.md @@ -9,13 +9,68 @@ The [CssExtract](./rspeedy.cssextract.md) controls the options of [CssExtractRsp **Signature:** ```typescript -export interface CssExtract +export interface CssExtract ``` ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [loaderOptions?](./rspeedy.cssextract.loaderoptions.md) | | [CssExtractRspackLoaderOptions](./rspeedy.cssextractrspackloaderoptions.md) \| undefined | _(Optional)_ The options of CSS extract loader. | -| [pluginOptions?](./rspeedy.cssextract.pluginoptions.md) | | [CssExtractRspackPluginOptions](./rspeedy.cssextractrspackpluginoptions.md) \| undefined | _(Optional)_ The options for [CssExtractRspackPlugin](https://rspack.dev/plugins/rspack/css-extract-rspack-plugin) | + + + +
+Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[loaderOptions?](./rspeedy.cssextract.loaderoptions.md) + + + + + + + +[CssExtractRspackLoaderOptions](./rspeedy.cssextractrspackloaderoptions.md) \| undefined + + + + +_(Optional)_ The options of CSS extract loader. + + +
+ +[pluginOptions?](./rspeedy.cssextract.pluginoptions.md) + + + + + + + +[CssExtractRspackPluginOptions](./rspeedy.cssextractrspackpluginoptions.md) \| undefined + + + + +_(Optional)_ The options for [CssExtractRspackPlugin](https://rspack.dev/plugins/rspack/css-extract-rspack-plugin) + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.cssextractrspackloaderoptions.md b/docs/zh/api/rspeedy/rspeedy.cssextractrspackloaderoptions.md index 6b6c081f5..707240e60 100644 --- a/docs/zh/api/rspeedy/rspeedy.cssextractrspackloaderoptions.md +++ b/docs/zh/api/rspeedy/rspeedy.cssextractrspackloaderoptions.md @@ -14,7 +14,45 @@ export interface CssExtractRspackLoaderOptions ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [esModule?](./rspeedy.cssextractrspackloaderoptions.esmodule.md) | | boolean \| undefined | _(Optional)_ The same as [https://github.com/webpack-contrib/mini-css-extract-plugin\#esModule](https://github.com/webpack-contrib/mini-css-extract-plugin#esModule). By default, @lynx-js/css-extract-webpack-plugin generates JS modules that use the ES modules syntax. There are some cases in which using ES modules is beneficial, like in the case of module concatenation and tree shaking. | + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[esModule?](./rspeedy.cssextractrspackloaderoptions.esmodule.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ The same as [https://github.com/webpack-contrib/mini-css-extract-plugin\#esModule](https://github.com/webpack-contrib/mini-css-extract-plugin#esModule). By default, `@lynx-js/css-extract-webpack-plugin` generates JS modules that use the ES modules syntax. There are some cases in which using ES modules is beneficial, like in the case of module concatenation and tree shaking. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.cssextractrspackpluginoptions.md b/docs/zh/api/rspeedy/rspeedy.cssextractrspackpluginoptions.md index 458744cb9..829470235 100644 --- a/docs/zh/api/rspeedy/rspeedy.cssextractrspackpluginoptions.md +++ b/docs/zh/api/rspeedy/rspeedy.cssextractrspackpluginoptions.md @@ -9,13 +9,68 @@ The options for [CssExtractRspackPlugin](https://rspack.dev/plugins/rspack/css-e **Signature:** ```typescript -export interface CssExtractRspackPluginOptions +export interface CssExtractRspackPluginOptions ``` ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [ignoreOrder?](./rspeedy.cssextractrspackpluginoptions.ignoreorder.md) | | boolean \| undefined | _(Optional)_ | -| [pathinfo?](./rspeedy.cssextractrspackpluginoptions.pathinfo.md) | | boolean \| undefined | _(Optional)_ | + + + +
+Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[ignoreOrder?](./rspeedy.cssextractrspackpluginoptions.ignoreorder.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ + + +
+ +[pathinfo?](./rspeedy.cssextractrspackpluginoptions.pathinfo.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.cssloader.md b/docs/zh/api/rspeedy/rspeedy.cssloader.md index 33b28588a..46be3e5de 100644 --- a/docs/zh/api/rspeedy/rspeedy.cssloader.md +++ b/docs/zh/api/rspeedy/rspeedy.cssloader.md @@ -32,8 +32,64 @@ const defaultOptions = { ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [importLoaders?](./rspeedy.cssloader.importloaders.md) | | 0 \| 1 \| 2 \| undefined | _(Optional)_ The option importLoaders allows you to configure how many loaders before css-loader should be applied to @imported resources and CSS modules imports. | -| [modules?](./rspeedy.cssloader.modules.md) | | boolean \| [CssLoaderModules](./rspeedy.cssloadermodules.md) \| undefined | _(Optional)_ The [cssLoader.modules](./rspeedy.cssloadermodules.md) option enables/disables the CSS Modules specification and setup basic behavior. | + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[importLoaders?](./rspeedy.cssloader.importloaders.md) + + + + + + + +0 \| 1 \| 2 \| undefined + + + + +_(Optional)_ The option `importLoaders` allows you to configure how many loaders before `css-loader` should be applied to `@imported` resources and CSS modules imports. + + +
+ +[modules?](./rspeedy.cssloader.modules.md) + + + + + + + +boolean \| [CssLoaderModules](./rspeedy.cssloadermodules.md) \| undefined + + + + +_(Optional)_ The [cssLoader.modules](./rspeedy.cssloadermodules.md) option enables/disables the CSS Modules specification and setup basic behavior. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.cssloadermodules.md b/docs/zh/api/rspeedy/rspeedy.cssloadermodules.md index c5aab912e..8593b317a 100644 --- a/docs/zh/api/rspeedy/rspeedy.cssloadermodules.md +++ b/docs/zh/api/rspeedy/rspeedy.cssloadermodules.md @@ -14,10 +14,102 @@ export interface CssLoaderModules ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [auto?](./rspeedy.cssloadermodules.auto.md) | | boolean \| RegExp \| ((filename: string) => boolean) \| undefined | _(Optional)_ The auto option allows CSS modules to be automatically enabled based on their filenames. | -| [exportLocalsConvention?](./rspeedy.cssloadermodules.exportlocalsconvention.md) | | [CssModuleLocalsConvention](./rspeedy.cssmodulelocalsconvention.md) \| undefined | _(Optional)_ The style of exported class names. | -| [localIdentName?](./rspeedy.cssloadermodules.localidentname.md) | | string \| undefined | _(Optional)_ Sets the format of the className generated by CSS Modules after compilation. | -| [namedExport?](./rspeedy.cssloadermodules.namedexport.md) | | boolean \| undefined | _(Optional)_ Enables/disables ES modules named export for locals. | + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[auto?](./rspeedy.cssloadermodules.auto.md) + + + + + + + +boolean \| RegExp \| ((filename: string) => boolean) \| undefined + + + + +_(Optional)_ The `auto` option allows CSS modules to be automatically enabled based on their filenames. + + +
+ +[exportLocalsConvention?](./rspeedy.cssloadermodules.exportlocalsconvention.md) + + + + + + + +[CssModuleLocalsConvention](./rspeedy.cssmodulelocalsconvention.md) \| undefined + + + + +_(Optional)_ The style of exported class names. + + +
+ +[localIdentName?](./rspeedy.cssloadermodules.localidentname.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ Sets the format of the className generated by CSS Modules after compilation. + + +
+ +[namedExport?](./rspeedy.cssloadermodules.namedexport.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ Enables/disables ES modules named export for locals. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.cssmodules.md b/docs/zh/api/rspeedy/rspeedy.cssmodules.md index 462a0517e..b63d7c3a9 100644 --- a/docs/zh/api/rspeedy/rspeedy.cssmodules.md +++ b/docs/zh/api/rspeedy/rspeedy.cssmodules.md @@ -18,10 +18,102 @@ The CSS module is enabled for `*.module.css`, `*.module.scss` and `*.mod ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [auto?](./rspeedy.cssmodules.auto.md) | | boolean \| RegExp \| ((filename: string) => boolean) \| undefined | _(Optional)_ The auto option allows CSS modules to be automatically enabled based on their filenames. | -| [exportGlobals?](./rspeedy.cssmodules.exportglobals.md) | | boolean \| undefined | _(Optional)_ Allows exporting names from global class names, so you can use them via import. | -| [exportLocalsConvention?](./rspeedy.cssmodules.exportlocalsconvention.md) | | [CssModuleLocalsConvention](./rspeedy.cssmodulelocalsconvention.md) \| undefined | _(Optional)_ The style of exported class names. | -| [localIdentName?](./rspeedy.cssmodules.localidentname.md) | | string \| undefined | _(Optional)_ Sets the format of the className generated by CSS Modules after compilation. | + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[auto?](./rspeedy.cssmodules.auto.md) + + + + + + + +boolean \| RegExp \| ((filename: string) => boolean) \| undefined + + + + +_(Optional)_ The `auto` option allows CSS modules to be automatically enabled based on their filenames. + + +
+ +[exportGlobals?](./rspeedy.cssmodules.exportglobals.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ Allows exporting names from global class names, so you can use them via import. + + +
+ +[exportLocalsConvention?](./rspeedy.cssmodules.exportlocalsconvention.md) + + + + + + + +[CssModuleLocalsConvention](./rspeedy.cssmodulelocalsconvention.md) \| undefined + + + + +_(Optional)_ The style of exported class names. + + +
+ +[localIdentName?](./rspeedy.cssmodules.localidentname.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ Sets the format of the className generated by CSS Modules after compilation. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.decorators.md b/docs/zh/api/rspeedy/rspeedy.decorators.md index 9ad516c89..f908b1c75 100644 --- a/docs/zh/api/rspeedy/rspeedy.decorators.md +++ b/docs/zh/api/rspeedy/rspeedy.decorators.md @@ -18,7 +18,45 @@ See [Decorators.version](./rspeedy.decorators.version.md) for more information. ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [version?](./rspeedy.decorators.version.md) | | 'legacy' \| '2022-03' | _(Optional)_ Specify the decorator syntax version to be used. | + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[version?](./rspeedy.decorators.version.md) + + + + + + + +'legacy' \| '2022-03' + + + + +_(Optional)_ Specify the decorator syntax version to be used. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.defineconfig.md b/docs/zh/api/rspeedy/rspeedy.defineconfig.md index 179c4607e..7069d55ce 100644 --- a/docs/zh/api/rspeedy/rspeedy.defineconfig.md +++ b/docs/zh/api/rspeedy/rspeedy.defineconfig.md @@ -14,9 +14,39 @@ export declare function defineConfig(config: Config): Config; ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| config | [Config](./rspeedy.config.md) | The config of Rspeedy. | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +config + + + + +[Config](./rspeedy.config.md) + + + + +The config of Rspeedy. + + +
**Returns:** diff --git a/docs/zh/api/rspeedy/rspeedy.defineconfig_1.md b/docs/zh/api/rspeedy/rspeedy.defineconfig_1.md index 779f8471e..4cd819e70 100644 --- a/docs/zh/api/rspeedy/rspeedy.defineconfig_1.md +++ b/docs/zh/api/rspeedy/rspeedy.defineconfig_1.md @@ -14,9 +14,39 @@ export declare function defineConfig(config: (params: ConfigParams) => Config): ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| config | (params: [ConfigParams](./rspeedy.configparams.md)) => [Config](./rspeedy.config.md) | The function that returns a config of Rspeedy. | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +config + + + + +(params: [ConfigParams](./rspeedy.configparams.md)) => [Config](./rspeedy.config.md) + + + + +The function that returns a config of Rspeedy. + + +
**Returns:** diff --git a/docs/zh/api/rspeedy/rspeedy.defineconfig_2.md b/docs/zh/api/rspeedy/rspeedy.defineconfig_2.md index 27f5139ed..6c4152fb9 100644 --- a/docs/zh/api/rspeedy/rspeedy.defineconfig_2.md +++ b/docs/zh/api/rspeedy/rspeedy.defineconfig_2.md @@ -14,9 +14,39 @@ export declare function defineConfig(config: Promise): Promise; ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| config | Promise<[Config](./rspeedy.config.md)> | The promise that resolves to a config of Rspeedy. | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +config + + + + +Promise<[Config](./rspeedy.config.md)> + + + + +The promise that resolves to a config of Rspeedy. + + +
**Returns:** diff --git a/docs/zh/api/rspeedy/rspeedy.defineconfig_3.md b/docs/zh/api/rspeedy/rspeedy.defineconfig_3.md index cffeca674..79e1df54b 100644 --- a/docs/zh/api/rspeedy/rspeedy.defineconfig_3.md +++ b/docs/zh/api/rspeedy/rspeedy.defineconfig_3.md @@ -14,9 +14,39 @@ export declare function defineConfig(config: (params: ConfigParams) => Promise) => Promise<[Config](./rspeedy.config.md)> | The function that returns a promise that resolves to a config of Rspeedy. | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +config + + + + +(params: [ConfigParams](./rspeedy.configparams.md)) => Promise<[Config](./rspeedy.config.md)> + + + + +The function that returns a promise that resolves to a config of Rspeedy. + + +
**Returns:** diff --git a/docs/zh/api/rspeedy/rspeedy.dev.md b/docs/zh/api/rspeedy/rspeedy.dev.md index 25e228973..aaed79bc6 100644 --- a/docs/zh/api/rspeedy/rspeedy.dev.md +++ b/docs/zh/api/rspeedy/rspeedy.dev.md @@ -14,13 +14,167 @@ export interface Dev ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [assetPrefix?](./rspeedy.dev.assetprefix.md) | | string \| boolean \| undefined | _(Optional)_ The [Dev.assetPrefix](./rspeedy.dev.assetprefix.md) is used to set the URL prefix for static assets during development. | -| [client?](./rspeedy.dev.client.md) | | [Client](./rspeedy.devclient.md) \| undefined | _(Optional)_ Configuration of the development client. | -| [hmr?](./rspeedy.dev.hmr.md) | | boolean \| undefined | _(Optional)_ Whether to enable Hot Module Replacement (HMR). | -| [liveReload?](./rspeedy.dev.livereload.md) | | boolean \| undefined |

_(Optional)_ Whether to enable live reload functionality.

Defaults to true.

Live reload is used as a fallback when [Dev.hmr](./rspeedy.dev.hmr.md) is disabled or cannot be used in certain scenarios. When enabled, the page will automatically refresh when source files are changed.

To completely disable both HMR and live reload, set both dev.hmr and dev.liveReload to false. Then, no WebSocket requests will be made to the dev server on the page, and the page will not automatically refresh when file changes.

| -| [progressBar?](./rspeedy.dev.progressbar.md) | | boolean \| { id?: string; } \| undefined |

_(Optional)_ Whether to display progress bar during compilation.

Defaults to true.

| -| [watchFiles?](./rspeedy.dev.watchfiles.md) | | WatchFiles \| WatchFiles\[\] \| undefined | _(Optional)_ Watch specified files and directories for changes. When a file change is detected, it can trigger a page reload or restart the dev server. | -| [writeToDisk?](./rspeedy.dev.writetodisk.md) | | boolean \| ((filename: string) => boolean) \| undefined | _(Optional)_ Used to control whether the build artifacts of the development environment are written to the disk. | + + + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[assetPrefix?](./rspeedy.dev.assetprefix.md) + + + + + + + +string \| boolean \| undefined + + + + +_(Optional)_ The [Dev.assetPrefix](./rspeedy.dev.assetprefix.md) is used to set the URL prefix for static assets during development. + + +
+ +[client?](./rspeedy.dev.client.md) + + + + + + + +[Client](./rspeedy.devclient.md) \| undefined + + + + +_(Optional)_ Configuration of the development client. + + +
+ +[hmr?](./rspeedy.dev.hmr.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ Whether to enable Hot Module Replacement (HMR). + + +
+ +[liveReload?](./rspeedy.dev.livereload.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ Whether to enable live reload functionality. + +Defaults to `true`. + +Live reload is used as a fallback when [Dev.hmr](./rspeedy.dev.hmr.md) is disabled or cannot be used in certain scenarios. When enabled, the page will automatically refresh when source files are changed. + +To completely disable both HMR and live reload, set both `dev.hmr` and `dev.liveReload` to `false`. Then, no WebSocket requests will be made to the dev server on the page, and the page will not automatically refresh when file changes. + + +
+ +[progressBar?](./rspeedy.dev.progressbar.md) + + + + + + + +boolean \| { id?: string; } \| undefined + + + + +_(Optional)_ Whether to display progress bar during compilation. + +Defaults to `true`. + + +
+ +[watchFiles?](./rspeedy.dev.watchfiles.md) + + + + + + + +WatchFiles \| WatchFiles\[\] \| undefined + + + + +_(Optional)_ Watch specified files and directories for changes. When a file change is detected, it can trigger a page reload or restart the dev server. + + +
+ +[writeToDisk?](./rspeedy.dev.writetodisk.md) + + + + + + + +boolean \| ((filename: string) => boolean) \| undefined + + + + +_(Optional)_ Used to control whether the build artifacts of the development environment are written to the disk. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.devclient.md b/docs/zh/api/rspeedy/rspeedy.devclient.md index 8752fff33..320acf254 100644 --- a/docs/zh/api/rspeedy/rspeedy.devclient.md +++ b/docs/zh/api/rspeedy/rspeedy.devclient.md @@ -14,7 +14,45 @@ export interface Client ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [websocketTransport?](./rspeedy.devclient.websockettransport.md) | | string \| undefined | _(Optional)_ The path to websocket. | + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[websocketTransport?](./rspeedy.devclient.websockettransport.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ The path to websocket. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.distpath.md b/docs/zh/api/rspeedy/rspeedy.distpath.md index de5f7a9e6..c54b9df05 100644 --- a/docs/zh/api/rspeedy/rspeedy.distpath.md +++ b/docs/zh/api/rspeedy/rspeedy.distpath.md @@ -19,7 +19,45 @@ More options can be found at [Rsbuild - distPath](https://rsbuild.dev/config/out ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [intermediate?](./rspeedy.distpath.intermediate.md) | | string \| undefined | _(Optional)_ The output directory of the intermediate files. | + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[intermediate?](./rspeedy.distpath.intermediate.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ The output directory of the intermediate files. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.entrydescription.import.md b/docs/zh/api/rspeedy/rspeedy.entrydescription.import.md index 7aa4f082e..a9d69b0db 100644 --- a/docs/zh/api/rspeedy/rspeedy.entrydescription.import.md +++ b/docs/zh/api/rspeedy/rspeedy.entrydescription.import.md @@ -12,6 +12,10 @@ The path to the entry module(s). import?: string | string[] | undefined; ``` +## Default Value + +`'./src/index.js'` + ## Remarks If no value is provided, the default value `src/index.js` will be used. diff --git a/docs/zh/api/rspeedy/rspeedy.entrydescription.md b/docs/zh/api/rspeedy/rspeedy.entrydescription.md index 1ad3b5162..98b54f191 100644 --- a/docs/zh/api/rspeedy/rspeedy.entrydescription.md +++ b/docs/zh/api/rspeedy/rspeedy.entrydescription.md @@ -18,8 +18,64 @@ It is similar with the [Entry Description Object](https://www.rspack.dev/config/ ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [import?](./rspeedy.entrydescription.import.md) | | string \| string\[\] \| undefined | _(Optional)_ The path to the entry module(s). | -| [publicPath?](./rspeedy.entrydescription.publicpath.md) | | string \| undefined | _(Optional)_ 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. | + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[import?](./rspeedy.entrydescription.import.md) + + + + + + + +string \| string\[\] \| undefined + + + + +_(Optional)_ The path to the entry module(s). + + +
+ +[publicPath?](./rspeedy.entrydescription.publicpath.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ 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. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.exposedapi.md b/docs/zh/api/rspeedy/rspeedy.exposedapi.md index f23613235..ae0a8c938 100644 --- a/docs/zh/api/rspeedy/rspeedy.exposedapi.md +++ b/docs/zh/api/rspeedy/rspeedy.exposedapi.md @@ -28,11 +28,121 @@ const RsbuildPlugin = { ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [config](./rspeedy.exposedapi.config.md) | | [Config](./rspeedy.config.md) | The user config. | -| [debug](./rspeedy.exposedapi.debug.md) | | (message: string \| (() => string)) => void | Print debug logs. | -| [exit](./rspeedy.exposedapi.exit.md) | | (code?: number) => Promise<void> \| void | Exit the process. | -| [logger](./rspeedy.exposedapi.logger.md) | | typeof logger | Get the Rspeedy logger. | -| [version](./rspeedy.exposedapi.version.md) | | string | The version of Rspeedy. | + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[config](./rspeedy.exposedapi.config.md) + + + + + + + +[Config](./rspeedy.config.md) + + + + +The user config. + + +
+ +[debug](./rspeedy.exposedapi.debug.md) + + + + + + + +(message: string \| (() => string)) => void + + + + +Print debug logs. + + +
+ +[exit](./rspeedy.exposedapi.exit.md) + + + + + + + +(code?: number) => Promise<void> \| void + + + + +Exit the process. + + +
+ +[logger](./rspeedy.exposedapi.logger.md) + + + + + + + +typeof logger + + + + +Get the Rspeedy logger. + + +
+ +[version](./rspeedy.exposedapi.version.md) + + + + + + + +string + + + + +The version of Rspeedy. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.filename.md b/docs/zh/api/rspeedy/rspeedy.filename.md index 8690899da..49dd4ff55 100644 --- a/docs/zh/api/rspeedy/rspeedy.filename.md +++ b/docs/zh/api/rspeedy/rspeedy.filename.md @@ -18,16 +18,216 @@ If a string is provided, it will be used as [Filename.bundle](./rspeedy.filename ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [assets?](./rspeedy.filename.assets.md) | | Rspack.AssetModuleFilename | _(Optional)_ The name of other assets, except for above (image, svg, font, html, wasm...) | -| [bundle?](./rspeedy.filename.bundle.md) | | string \| undefined | _(Optional)_ The name of the bundle files. | -| [css?](./rspeedy.filename.css.md) | | Rspack.CssFilename \| undefined | _(Optional)_ The name of the CSS files. | -| [font?](./rspeedy.filename.font.md) | | Rspack.AssetModuleFilename \| undefined | _(Optional)_ The name of the font files. | -| [image?](./rspeedy.filename.image.md) | | Rspack.AssetModuleFilename \| undefined | _(Optional)_ The name of non-SVG images. | -| [js?](./rspeedy.filename.js.md) | | Rspack.Filename \| undefined | _(Optional)_ The name of the JavaScript files. | -| [media?](./rspeedy.filename.media.md) | | Rspack.AssetModuleFilename \| undefined | _(Optional)_ The name of media assets, such as video. | -| [svg?](./rspeedy.filename.svg.md) | | Rspack.AssetModuleFilename \| undefined | _(Optional)_ The name of the SVG images. | -| [template?](./rspeedy.filename.template.md) | | string \| undefined | _(Optional)_ The name of the template files. | -| [wasm?](./rspeedy.filename.wasm.md) | | Rspack.WebassemblyModuleFilename | _(Optional)_ The name of WebAssembly files. | + + + + + + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[assets?](./rspeedy.filename.assets.md) + + + + + + + +Rspack.AssetModuleFilename + + + + +_(Optional)_ The name of other assets, except for above (image, svg, font, html, wasm...) + + +
+ +[bundle?](./rspeedy.filename.bundle.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ The name of the bundle files. + + +
+ +[css?](./rspeedy.filename.css.md) + + + + + + + +Rspack.CssFilename \| undefined + + + + +_(Optional)_ The name of the CSS files. + + +
+ +[font?](./rspeedy.filename.font.md) + + + + + + + +Rspack.AssetModuleFilename \| undefined + + + + +_(Optional)_ The name of the font files. + + +
+ +[image?](./rspeedy.filename.image.md) + + + + + + + +Rspack.AssetModuleFilename \| undefined + + + + +_(Optional)_ The name of non-SVG images. + + +
+ +[js?](./rspeedy.filename.js.md) + + + + + + + +Rspack.Filename \| undefined + + + + +_(Optional)_ The name of the JavaScript files. + + +
+ +[media?](./rspeedy.filename.media.md) + + + + + + + +Rspack.AssetModuleFilename \| undefined + + + + +_(Optional)_ The name of media assets, such as video. + + +
+ +[svg?](./rspeedy.filename.svg.md) + + + + + + + +Rspack.AssetModuleFilename \| undefined + + + + +_(Optional)_ The name of the SVG images. + + +
+ +[template?](./rspeedy.filename.template.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ The name of the template files. + + +
+ +[wasm?](./rspeedy.filename.wasm.md) + + + + + + + +Rspack.WebassemblyModuleFilename + + + + +_(Optional)_ The name of WebAssembly files. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.loadconfig.md b/docs/zh/api/rspeedy/rspeedy.loadconfig.md index 09861271c..44dce5dd0 100644 --- a/docs/zh/api/rspeedy/rspeedy.loadconfig.md +++ b/docs/zh/api/rspeedy/rspeedy.loadconfig.md @@ -14,9 +14,39 @@ export declare function loadConfig(loadConfigOptions: LoadConfigOptions): Promis ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| loadConfigOptions | [LoadConfigOptions](./rspeedy.loadconfigoptions.md) | the options of loadConfig method. | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +loadConfigOptions + + + + +[LoadConfigOptions](./rspeedy.loadconfigoptions.md) + + + + +the options of `loadConfig` method. + + +
**Returns:** diff --git a/docs/zh/api/rspeedy/rspeedy.loadconfigoptions.md b/docs/zh/api/rspeedy/rspeedy.loadconfigoptions.md index 388362b5e..ecf7ff2f3 100644 --- a/docs/zh/api/rspeedy/rspeedy.loadconfigoptions.md +++ b/docs/zh/api/rspeedy/rspeedy.loadconfigoptions.md @@ -14,8 +14,64 @@ export interface LoadConfigOptions ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [configPath?](./rspeedy.loadconfigoptions.configpath.md) | | string \| undefined | _(Optional)_ | -| [cwd?](./rspeedy.loadconfigoptions.cwd.md) | | string \| undefined | _(Optional)_ | + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[configPath?](./rspeedy.loadconfigoptions.configpath.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ + + +
+ +[cwd?](./rspeedy.loadconfigoptions.cwd.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.loadconfigresult.md b/docs/zh/api/rspeedy/rspeedy.loadconfigresult.md index 9ea620f9d..779617991 100644 --- a/docs/zh/api/rspeedy/rspeedy.loadconfigresult.md +++ b/docs/zh/api/rspeedy/rspeedy.loadconfigresult.md @@ -14,8 +14,64 @@ export interface LoadConfigResult ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [configPath](./rspeedy.loadconfigresult.configpath.md) | | string | The configuration path that has been loaded. | -| [content](./rspeedy.loadconfigresult.content.md) | | [Config](./rspeedy.config.md) | The configuration object that exported from the configuration file. | + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[configPath](./rspeedy.loadconfigresult.configpath.md) + + + + + + + +string + + + + +The configuration path that has been loaded. + + +
+ +[content](./rspeedy.loadconfigresult.content.md) + + + + + + + +[Config](./rspeedy.config.md) + + + + +The configuration object that exported from the configuration file. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.md b/docs/zh/api/rspeedy/rspeedy.md index 0529e674a..c7bba5257 100644 --- a/docs/zh/api/rspeedy/rspeedy.md +++ b/docs/zh/api/rspeedy/rspeedy.md @@ -8,7 +8,7 @@ The document contains all the configurations of the `@lynx-js/rspeedy` package. ## Example -Use `lynx.config.ts` with [defineConfig()](./rspeedy.defineconfig.md) to get better TypeScript intellisense. +Use `lynx.config.ts` with to get better TypeScript intellisense. ```ts import { defineConfig } from '@lynx-js/rspeedy' @@ -19,66 +19,551 @@ export default defineConfig({ ## Functions -| Function | Description | -| --- | --- | -| [createRspeedy({ cwd, rspeedyConfig, loadEnv, environment, callerName, })](./rspeedy.createrspeedy.md) | The createRspeedy method can let you create a Rspeedy instance and you can customize the build or development process in Node.js Runtime. | -| [defineConfig(config)](./rspeedy.defineconfig.md) | The defineConfig method is a helper function used to get TypeScript intellisense. | -| [defineConfig(config)](./rspeedy.defineconfig_1.md) | The defineConfig method is a helper function used to get TypeScript intellisense. | -| [defineConfig(config)](./rspeedy.defineconfig_2.md) | The defineConfig method is a helper function used to get TypeScript intellisense. | -| [defineConfig(config)](./rspeedy.defineconfig_3.md) | The defineConfig method is a helper function used to get TypeScript intellisense. | -| [loadConfig(loadConfigOptions)](./rspeedy.loadconfig.md) | Load the build config by the config path. | -| [mergeRspeedyConfig(configs)](./rspeedy.mergerspeedyconfig.md) | Merge multiple Rspeedy configuration objects. | + + + + + + + + +
+ +Function + + + + +Description + + +
+ +[createRspeedy({ cwd, rspeedyConfig, loadEnv, environment, callerName, }, input)](./rspeedy.createrspeedy.md) + + + + +The `createRspeedy` method can let you create a Rspeedy instance and you can customize the build or development process in Node.js Runtime. + + +
+ +[defineConfig(config)](./rspeedy.defineconfig.md) + + + + +The `defineConfig` method is a helper function used to get TypeScript intellisense. + + +
+ +[defineConfig(config)](./rspeedy.defineconfig_1.md) + + + + +The `defineConfig` method is a helper function used to get TypeScript intellisense. + + +
+ +[defineConfig(config)](./rspeedy.defineconfig_2.md) + + + + +The `defineConfig` method is a helper function used to get TypeScript intellisense. + + +
+ +[defineConfig(config)](./rspeedy.defineconfig_3.md) + + + + +The `defineConfig` method is a helper function used to get TypeScript intellisense. + + +
+ +[loadConfig(loadConfigOptions)](./rspeedy.loadconfig.md) + + + + +Load the build config by the config path. + + +
+ +[mergeRspeedyConfig(configs)](./rspeedy.mergerspeedyconfig.md) + + + + +Merge multiple Rspeedy configuration objects. + + +
## Interfaces -| Interface | Description | -| --- | --- | -| [BuildCache](./rspeedy.buildcache.md) |

**_(BETA)_** Enable or configure persistent build cache.

This feature is experimental and may be changed in the future.

| -| [ChunkSplit](./rspeedy.chunksplit.md) | [Performance.chunkSplit](./rspeedy.performance.chunksplit.md) is used to configure the chunk splitting strategy. | -| [ChunkSplitBySize](./rspeedy.chunksplitbysize.md) | [Performance.chunkSplit](./rspeedy.performance.chunksplit.md) is used to configure the chunk splitting strategy. | -| [ChunkSplitCustom](./rspeedy.chunksplitcustom.md) | [Performance.chunkSplit](./rspeedy.performance.chunksplit.md) is used to configure the chunk splitting strategy. | -| [Config](./rspeedy.config.md) | The Config is the configuration that rspeedy uses. | -| [ConfigParams](./rspeedy.configparams.md) | Parameters for the function exported from lynx.config.js. | -| [CreateRspeedyOptions](./rspeedy.createrspeedyoptions.md) | The options of createRspeedy method. | -| [CssExtract](./rspeedy.cssextract.md) | The [CssExtract](./rspeedy.cssextract.md) controls the options of [CssExtractRspackPlugin](https://www.rspack.dev/plugins/rspack/css-extract-rspack-plugin) | -| [CssExtractRspackLoaderOptions](./rspeedy.cssextractrspackloaderoptions.md) | The options of CSS extract loader. | -| [CssExtractRspackPluginOptions](./rspeedy.cssextractrspackpluginoptions.md) | The options for [CssExtractRspackPlugin](https://rspack.dev/plugins/rspack/css-extract-rspack-plugin) | -| [CssLoader](./rspeedy.cssloader.md) | The [CssLoader](./rspeedy.cssloader.md) controls the options of [css-loader](https://github.com/webpack-contrib/css-loader). | -| [CssLoaderModules](./rspeedy.cssloadermodules.md) | The [cssLoader.modules](./rspeedy.cssloadermodules.md) option enables/disables the CSS Modules specification and setup basic behavior. | -| [CssModules](./rspeedy.cssmodules.md) | The [CssModules](./rspeedy.cssmodules.md) option is used for the customization of CSS Modules configurations. | -| [Decorators](./rspeedy.decorators.md) | Used to configure the decorators syntax. | -| [Dev](./rspeedy.dev.md) | The [Dev](./rspeedy.dev.md) option is used to control the behavior related with development. Including: HMR, DevServer, etc. | -| [DevClient](./rspeedy.devclient.md) | Configuration of the development client. | -| [DistPath](./rspeedy.distpath.md) | Set the directory of the dist files. | -| [EntryDescription](./rspeedy.entrydescription.md) | The EntryDescription describes a entry. It is useful when the project has multiple entries with different configuration. | -| [ExposedAPI](./rspeedy.exposedapi.md) | The exposed API of Rspeedy. Can be used in Rsbuild plugin with [api.useExposed](https://rsbuild.dev/plugins/dev/core#apiuseexposed). | -| [Filename](./rspeedy.filename.md) | The [Filename](./rspeedy.filename.md) determines the name of the JavaScript bundle file to be output. These bundles will be written to the directory specified by output.path. | -| [LoadConfigOptions](./rspeedy.loadconfigoptions.md) | The options of loadConfig. | -| [LoadConfigResult](./rspeedy.loadconfigresult.md) | The result of [loadConfig()](./rspeedy.loadconfig.md). | -| [Minify](./rspeedy.minify.md) | The [Minify](./rspeedy.minify.md) configures whether to enable code minification in the production build, or to configure minimizer options. | -| [Output](./rspeedy.output.md) | The [Output](./rspeedy.output.md) option is used to set how and where should the bundles and assets output. | -| [Performance](./rspeedy.performance.md) | The [Performance](./rspeedy.performance.md) option is used to optimize the build-time and runtime performance. | -| [Resolve](./rspeedy.resolve.md) | The [Resolve](./rspeedy.resolve.md) option is used to control the resolution behavior of Rspack. | -| [Server](./rspeedy.server.md) | The [Server](./rspeedy.server.md) option changes the behavior of dev-server. | -| [Source](./rspeedy.source.md) | The [Source](./rspeedy.source.md) option changes the behavior of source files. | -| [SourceMap](./rspeedy.sourcemap.md) | The [SourceMap](./rspeedy.sourcemap.md) configures whether and how to generate source-map for outputs. | -| [Tools](./rspeedy.tools.md) | The [Tools](./rspeedy.tools.md) options changes the behavior of various building tools. | -| [TransformImport](./rspeedy.transformimport.md) | The [TransformImport](./rspeedy.transformimport.md) option transforms the import paths to enable modular imports from subpaths of third-party packages, similar to the functionality provided by [babel-plugin-import](https://npmjs.com/package/babel-plugin-import). | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +Interface + + + + +Description + + +
+ +[BuildCache](./rspeedy.buildcache.md) + + + + +**_(BETA)_** Enable or configure persistent build cache. + +This feature is experimental and may be changed in the future. + + +
+ +[ChunkSplit](./rspeedy.chunksplit.md) + + + + +[Performance.chunkSplit](./rspeedy.performance.chunksplit.md) is used to configure the chunk splitting strategy. + + +
+ +[ChunkSplitBySize](./rspeedy.chunksplitbysize.md) + + + + +[Performance.chunkSplit](./rspeedy.performance.chunksplit.md) is used to configure the chunk splitting strategy. + + +
+ +[ChunkSplitCustom](./rspeedy.chunksplitcustom.md) + + + + +[Performance.chunkSplit](./rspeedy.performance.chunksplit.md) is used to configure the chunk splitting strategy. + + +
+ +[Config](./rspeedy.config.md) + + + + +The `Config` is the configuration that `rspeedy` uses. + + +
+ +[ConfigParams](./rspeedy.configparams.md) + + + + +Parameters for the function exported from `lynx.config.js`. + + +
+ +[CreateRspeedyOptions](./rspeedy.createrspeedyoptions.md) + + + + +The options of `createRspeedy` method. + + +
+ +[CssExtract](./rspeedy.cssextract.md) + + + + +The [CssExtract](./rspeedy.cssextract.md) controls the options of [CssExtractRspackPlugin](https://www.rspack.dev/plugins/rspack/css-extract-rspack-plugin) + + +
+ +[CssExtractRspackLoaderOptions](./rspeedy.cssextractrspackloaderoptions.md) + + + + +The options of CSS extract loader. + + +
+ +[CssExtractRspackPluginOptions](./rspeedy.cssextractrspackpluginoptions.md) + + + + +The options for [CssExtractRspackPlugin](https://rspack.dev/plugins/rspack/css-extract-rspack-plugin) + + +
+ +[CssLoader](./rspeedy.cssloader.md) + + + + +The [CssLoader](./rspeedy.cssloader.md) controls the options of [css-loader](https://github.com/webpack-contrib/css-loader). + + +
+ +[CssLoaderModules](./rspeedy.cssloadermodules.md) + + + + +The [cssLoader.modules](./rspeedy.cssloadermodules.md) option enables/disables the CSS Modules specification and setup basic behavior. + + +
+ +[CssModules](./rspeedy.cssmodules.md) + + + + +The [CssModules](./rspeedy.cssmodules.md) option is used for the customization of CSS Modules configurations. + + +
+ +[Decorators](./rspeedy.decorators.md) + + + + +Used to configure the decorators syntax. + + +
+ +[Dev](./rspeedy.dev.md) + + + + +The [Dev](./rspeedy.dev.md) option is used to control the behavior related with development. Including: HMR, DevServer, etc. + + +
+ +[DevClient](./rspeedy.devclient.md) + + + + +Configuration of the development client. + + +
+ +[DistPath](./rspeedy.distpath.md) + + + + +Set the directory of the dist files. + + +
+ +[EntryDescription](./rspeedy.entrydescription.md) + + + + +The `EntryDescription` describes a entry. It is useful when the project has multiple entries with different configuration. + + +
+ +[ExposedAPI](./rspeedy.exposedapi.md) + + + + +The exposed API of Rspeedy. Can be used in Rsbuild plugin with [api.useExposed](https://rsbuild.dev/plugins/dev/core#apiuseexposed). + + +
+ +[Filename](./rspeedy.filename.md) + + + + +The [Filename](./rspeedy.filename.md) determines the name of the JavaScript bundle file to be output. These bundles will be written to the directory specified by output.path. + + +
+ +[LoadConfigOptions](./rspeedy.loadconfigoptions.md) + + + + +The options of loadConfig. + + +
+ +[LoadConfigResult](./rspeedy.loadconfigresult.md) + + + + +The result of [loadConfig()](./rspeedy.loadconfig.md). + + +
+ +[Minify](./rspeedy.minify.md) + + + + +The [Minify](./rspeedy.minify.md) configures whether to enable code minification in the production build, or to configure minimizer options. + + +
+ +[Output](./rspeedy.output.md) + + + + +The [Output](./rspeedy.output.md) option is used to set how and where should the bundles and assets output. + + +
+ +[Performance](./rspeedy.performance.md) + + + + +The [Performance](./rspeedy.performance.md) option is used to optimize the build-time and runtime performance. + + +
+ +[Resolve](./rspeedy.resolve.md) + + + + +The [Resolve](./rspeedy.resolve.md) option is used to control the resolution behavior of Rspack. + + +
+ +[Server](./rspeedy.server.md) + + + + +The [Server](./rspeedy.server.md) option changes the behavior of dev-server. + + +
+ +[Source](./rspeedy.source.md) + + + + +The [Source](./rspeedy.source.md) option changes the behavior of source files. + + +
+ +[SourceMap](./rspeedy.sourcemap.md) + + + + +The [SourceMap](./rspeedy.sourcemap.md) configures whether and how to generate source-map for outputs. + + +
+ +[Tools](./rspeedy.tools.md) + + + + +The [Tools](./rspeedy.tools.md) options changes the behavior of various building tools. + + +
+ +[TransformImport](./rspeedy.transformimport.md) + + + + +The [TransformImport](./rspeedy.transformimport.md) option transforms the import paths to enable modular imports from subpaths of third-party packages, similar to the functionality provided by [babel-plugin-import](https://npmjs.com/package/babel-plugin-import). + + +
## Variables -| Variable | Description | -| --- | --- | -| [rspackVersion](./rspeedy.rspackversion.md) | | -| [version](./rspeedy.version.md) | | + + + +
+ +Variable + + + + +Description + + +
+ +[rspackVersion](./rspeedy.rspackversion.md) + + + + + +
+ +[version](./rspeedy.version.md) + + + + + +
## Type Aliases -| Type Alias | Description | -| --- | --- | -| [ConsoleType](./rspeedy.consoletype.md) | The type of the console method. | -| [CssModuleLocalsConvention](./rspeedy.cssmodulelocalsconvention.md) | The style of exported class names. | -| [Entry](./rspeedy.entry.md) | The [Entry](./rspeedy.entry.md) option is used to set the entry module. | -| [RsdoctorRspackPluginOptions](./rspeedy.rsdoctorrspackpluginoptions.md) | | -| [RspeedyInstance](./rspeedy.rspeedyinstance.md) | The instance of Rspeedy. | + + + + + + +
+ +Type Alias + + + + +Description + + +
+ +[ConsoleType](./rspeedy.consoletype.md) + + + + +The type of the console method. + + +
+ +[CssModuleLocalsConvention](./rspeedy.cssmodulelocalsconvention.md) + + + + +The style of exported class names. + + +
+ +[Entry](./rspeedy.entry.md) + + + + +The [Entry](./rspeedy.entry.md) option is used to set the entry module. + + +
+ +[RsdoctorRspackPluginOptions](./rspeedy.rsdoctorrspackpluginoptions.md) + + + + + +
+ +[RspeedyInstance](./rspeedy.rspeedyinstance.md) + + + + +The instance of Rspeedy. + +
diff --git a/docs/zh/api/rspeedy/rspeedy.mergerspeedyconfig.md b/docs/zh/api/rspeedy/rspeedy.mergerspeedyconfig.md index 370121c84..7a8fd4cd9 100644 --- a/docs/zh/api/rspeedy/rspeedy.mergerspeedyconfig.md +++ b/docs/zh/api/rspeedy/rspeedy.mergerspeedyconfig.md @@ -14,9 +14,39 @@ export declare function mergeRspeedyConfig(...configs: Config[]): Config; ## Parameters -| Parameter | Type | Description | -| --- | --- | --- | -| configs | [Config](./rspeedy.config.md)\[\] | The Rspeedy configuration objects to merge. | + + +
+ +Parameter + + + + +Type + + + + +Description + + +
+ +configs + + + + +[Config](./rspeedy.config.md)\[\] + + + + +The Rspeedy configuration objects to merge. + + +
**Returns:** diff --git a/docs/zh/api/rspeedy/rspeedy.minify.backgroundoptions.md b/docs/zh/api/rspeedy/rspeedy.minify.backgroundoptions.md new file mode 100644 index 000000000..515052208 --- /dev/null +++ b/docs/zh/api/rspeedy/rspeedy.minify.backgroundoptions.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [@lynx-js/rspeedy](./rspeedy.md) > [Minify](./rspeedy.minify.md) > [backgroundOptions](./rspeedy.minify.backgroundoptions.md) + +## Minify.backgroundOptions property + +[Minify.backgroundOptions](./rspeedy.minify.backgroundoptions.md) is used to override [Minify.jsOptions](./rspeedy.minify.jsoptions.md) for background-thread bundles. + +**Signature:** + +```typescript +backgroundOptions?: Rspack.SwcJsMinimizerRspackPluginOptions | undefined; +``` + +## Remarks + +This option is deep-merged into [Minify.jsOptions](./rspeedy.minify.jsoptions.md). It is mainly used together with ReactLynx dual-thread outputs so that main-thread and background-thread bundles can use different compress rules. + diff --git a/docs/zh/api/rspeedy/rspeedy.minify.mainthreadoptions.md b/docs/zh/api/rspeedy/rspeedy.minify.mainthreadoptions.md new file mode 100644 index 000000000..32e16a192 --- /dev/null +++ b/docs/zh/api/rspeedy/rspeedy.minify.mainthreadoptions.md @@ -0,0 +1,46 @@ + + +[Home](./index.md) > [@lynx-js/rspeedy](./rspeedy.md) > [Minify](./rspeedy.minify.md) > [mainThreadOptions](./rspeedy.minify.mainthreadoptions.md) + +## Minify.mainThreadOptions property + +[Minify.mainThreadOptions](./rspeedy.minify.mainthreadoptions.md) is used to override [Minify.jsOptions](./rspeedy.minify.jsoptions.md) for main-thread bundles. + +**Signature:** + +```typescript +mainThreadOptions?: Rspack.SwcJsMinimizerRspackPluginOptions | undefined; +``` + +## Remarks + +This option is deep-merged into [Minify.jsOptions](./rspeedy.minify.jsoptions.md). It is mainly used together with ReactLynx dual-thread outputs so that main-thread and background-thread bundles can use different compress rules. + +## Example + + +```ts +import { defineConfig } from '@lynx-js/rspeedy' + +export default defineConfig({ + output: { + minify: { + jsOptions: { + minimizerOptions: { + compress: { + pure_funcs: ['console.log'], + }, + }, + }, + mainThreadOptions: { + minimizerOptions: { + compress: { + pure_funcs: ['NativeModules.call', 'lynx.getJSModule'], + }, + }, + }, + }, + }, +}) +``` + diff --git a/docs/zh/api/rspeedy/rspeedy.minify.md b/docs/zh/api/rspeedy/rspeedy.minify.md index 4068228d2..d36b54474 100644 --- a/docs/zh/api/rspeedy/rspeedy.minify.md +++ b/docs/zh/api/rspeedy/rspeedy.minify.md @@ -14,9 +14,121 @@ export interface Minify ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [css?](./rspeedy.minify.css.md) | | boolean \| undefined | _(Optional)_ Whether enable the CSS minification. | -| [js?](./rspeedy.minify.js.md) | | boolean \| undefined | _(Optional)_ Whether enable the JavaScript minification. | -| [jsOptions?](./rspeedy.minify.jsoptions.md) | | Rspack.SwcJsMinimizerRspackPluginOptions \| undefined | _(Optional)_ [Minify.jsOptions](./rspeedy.minify.jsoptions.md) is used to configure SWC minification options. | + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[backgroundOptions?](./rspeedy.minify.backgroundoptions.md) + + + + + + + +Rspack.SwcJsMinimizerRspackPluginOptions \| undefined + + + + +_(Optional)_ [Minify.backgroundOptions](./rspeedy.minify.backgroundoptions.md) is used to override [Minify.jsOptions](./rspeedy.minify.jsoptions.md) for background-thread bundles. + + +
+ +[css?](./rspeedy.minify.css.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ Whether enable the CSS minification. + + +
+ +[js?](./rspeedy.minify.js.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ Whether enable the JavaScript minification. + + +
+ +[jsOptions?](./rspeedy.minify.jsoptions.md) + + + + + + + +Rspack.SwcJsMinimizerRspackPluginOptions \| undefined + + + + +_(Optional)_ [Minify.jsOptions](./rspeedy.minify.jsoptions.md) is used to configure SWC minification options. + + +
+ +[mainThreadOptions?](./rspeedy.minify.mainthreadoptions.md) + + + + + + + +Rspack.SwcJsMinimizerRspackPluginOptions \| undefined + + + + +_(Optional)_ [Minify.mainThreadOptions](./rspeedy.minify.mainthreadoptions.md) is used to override [Minify.jsOptions](./rspeedy.minify.jsoptions.md) for main-thread bundles. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.output.md b/docs/zh/api/rspeedy/rspeedy.output.md index e024b4d80..dfbaf8b37 100644 --- a/docs/zh/api/rspeedy/rspeedy.output.md +++ b/docs/zh/api/rspeedy/rspeedy.output.md @@ -14,18 +14,254 @@ export interface Output ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [assetPrefix?](./rspeedy.output.assetprefix.md) | | string \| undefined | _(Optional)_ The [Output.assetPrefix](./rspeedy.output.assetprefix.md) is used to set the URL prefix for static assets. | -| [cleanDistPath?](./rspeedy.output.cleandistpath.md) | | boolean \| undefined | _(Optional)_ The [Output.cleanDistPath](./rspeedy.output.cleandistpath.md) option determines whether all files in the output directory (default: dist) are removed before the build starts. | -| [copy?](./rspeedy.output.copy.md) | | Rspack.CopyRspackPluginOptions \| Rspack.CopyRspackPluginOptions\['patterns'\] \| undefined | _(Optional)_ The [Output.copy](./rspeedy.output.copy.md) option is used for copying files to the dist directory. | -| [cssModules?](./rspeedy.output.cssmodules.md) | | [CssModules](./rspeedy.cssmodules.md) \| undefined | _(Optional)_ The [CssModules](./rspeedy.cssmodules.md) option is used for the customization of CSS Modules configurations. | -| [dataUriLimit?](./rspeedy.output.dataurilimit.md) | | number \| DataUriLimit \| undefined | _(Optional)_ The [Output.dataUriLimit](./rspeedy.output.dataurilimit.md) option is used to set the size threshold to inline static assets such as images and fonts. | -| [distPath?](./rspeedy.output.distpath.md) | | [DistPath](./rspeedy.distpath.md) \| undefined | _(Optional)_ Set the directory of the dist files. | -| [filename?](./rspeedy.output.filename.md) | | string \| [Filename](./rspeedy.filename.md) \| undefined | _(Optional)_ The [Filename](./rspeedy.filename.md) determines the name of the JavaScript bundle file to be output. These bundles will be written to the directory specified by output.path. | -| [filenameHash?](./rspeedy.output.filenamehash.md) | | boolean \| string \| undefined | _(Optional)_ The [Output.filenameHash](./rspeedy.output.filenamehash.md) option controls whether to add a hash value to the filename after the production build. | -| [inlineScripts?](./rspeedy.output.inlinescripts.md) | | InlineChunkConfig \| undefined | _(Optional)_ The [Output.inlineScripts](./rspeedy.output.inlinescripts.md) option controls whether to inline scripts into Lynx bundle (.lynx.bundle). | -| [legalComments?](./rspeedy.output.legalcomments.md) | | 'none' \| 'inline' \| 'linked' \| undefined | _(Optional)_ The [Output.legalComments](./rspeedy.output.legalcomments.md) controls how to handle the legal comment. | -| [minify?](./rspeedy.output.minify.md) | | [Minify](./rspeedy.minify.md) \| boolean \| undefined | _(Optional)_ The [Minify](./rspeedy.minify.md) configures whether to enable code minification in the production build, or to configure minimizer options. | -| [sourceMap?](./rspeedy.output.sourcemap.md) | | boolean \| [SourceMap](./rspeedy.sourcemap.md) \| undefined | _(Optional)_ The [SourceMap](./rspeedy.sourcemap.md) configures whether and how to generate source-map for outputs. | + + + + + + + + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[assetPrefix?](./rspeedy.output.assetprefix.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ The [Output.assetPrefix](./rspeedy.output.assetprefix.md) is used to set the URL prefix for static assets. + + +
+ +[cleanDistPath?](./rspeedy.output.cleandistpath.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ The [Output.cleanDistPath](./rspeedy.output.cleandistpath.md) option determines whether all files in the output directory (default: `dist`) are removed before the build starts. + + +
+ +[copy?](./rspeedy.output.copy.md) + + + + + + + +Rspack.CopyRspackPluginOptions \| Rspack.CopyRspackPluginOptions\['patterns'\] \| undefined + + + + +_(Optional)_ The [Output.copy](./rspeedy.output.copy.md) option is used for copying files to the dist directory. + + +
+ +[cssModules?](./rspeedy.output.cssmodules.md) + + + + + + + +[CssModules](./rspeedy.cssmodules.md) \| undefined + + + + +_(Optional)_ The [CssModules](./rspeedy.cssmodules.md) option is used for the customization of CSS Modules configurations. + + +
+ +[dataUriLimit?](./rspeedy.output.dataurilimit.md) + + + + + + + +number \| DataUriLimit \| undefined + + + + +_(Optional)_ The [Output.dataUriLimit](./rspeedy.output.dataurilimit.md) option is used to set the size threshold to inline static assets such as images and fonts. + + +
+ +[distPath?](./rspeedy.output.distpath.md) + + + + + + + +[DistPath](./rspeedy.distpath.md) \| undefined + + + + +_(Optional)_ Set the directory of the dist files. + + +
+ +[filename?](./rspeedy.output.filename.md) + + + + + + + +string \| [Filename](./rspeedy.filename.md) \| undefined + + + + +_(Optional)_ The [Filename](./rspeedy.filename.md) determines the name of the JavaScript bundle file to be output. These bundles will be written to the directory specified by output.path. + + +
+ +[filenameHash?](./rspeedy.output.filenamehash.md) + + + + + + + +boolean \| string \| undefined + + + + +_(Optional)_ The [Output.filenameHash](./rspeedy.output.filenamehash.md) option controls whether to add a hash value to the filename after the production build. + + +
+ +[inlineScripts?](./rspeedy.output.inlinescripts.md) + + + + + + + +InlineChunkConfig \| undefined + + + + +_(Optional)_ The [Output.inlineScripts](./rspeedy.output.inlinescripts.md) option controls whether to inline scripts into Lynx bundle (`.lynx.bundle`). + + +
+ +[legalComments?](./rspeedy.output.legalcomments.md) + + + + + + + +'none' \| 'inline' \| 'linked' \| undefined + + + + +_(Optional)_ The [Output.legalComments](./rspeedy.output.legalcomments.md) controls how to handle the legal comment. + + +
+ +[minify?](./rspeedy.output.minify.md) + + + + + + + +[Minify](./rspeedy.minify.md) \| boolean \| undefined + + + + +_(Optional)_ The [Minify](./rspeedy.minify.md) configures whether to enable code minification in the production build, or to configure minimizer options. + + +
+ +[sourceMap?](./rspeedy.output.sourcemap.md) + + + + + + + +boolean \| [SourceMap](./rspeedy.sourcemap.md) \| undefined + + + + +_(Optional)_ The [SourceMap](./rspeedy.sourcemap.md) configures whether and how to generate source-map for outputs. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.performance.md b/docs/zh/api/rspeedy/rspeedy.performance.md index 0212b75e5..acb66c62e 100644 --- a/docs/zh/api/rspeedy/rspeedy.performance.md +++ b/docs/zh/api/rspeedy/rspeedy.performance.md @@ -14,11 +14,127 @@ export interface Performance ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [buildCache?](./rspeedy.performance.buildcache.md) | | [BuildCache](./rspeedy.buildcache.md) \| boolean \| undefined |

**_(BETA)_** _(Optional)_ Enable or configure persistent build cache.

This feature is experimental and may be changed in the future.

| -| [chunkSplit?](./rspeedy.performance.chunksplit.md) | | [ChunkSplit](./rspeedy.chunksplit.md) \| [ChunkSplitBySize](./rspeedy.chunksplitbysize.md) \| [ChunkSplitCustom](./rspeedy.chunksplitcustom.md) \| undefined | _(Optional)_ [Performance.chunkSplit](./rspeedy.performance.chunksplit.md) is used to configure the chunk splitting strategy. | -| [printFileSize?](./rspeedy.performance.printfilesize.md) | | PerformanceConfig\['printFileSize'\] \| undefined |

_(Optional)_ Whether to print the file sizes after production build.

[Performance.printFileSize](./rspeedy.performance.printfilesize.md)

See [Rsbuild - performance.printFileSize](https://rsbuild.dev/config/performance/print-file-size) for details.

| -| [profile?](./rspeedy.performance.profile.md) | | boolean \| undefined | _(Optional)_ Whether capture timing information in the build time and the runtime, the same as the [profile](https://rspack.dev/config/other-options#profile) config of Rspack. | -| [removeConsole?](./rspeedy.performance.removeconsole.md) | | boolean \| [ConsoleType](./rspeedy.consoletype.md)\[\] \| undefined | _(Optional)_ Whether to remove console.[methodName] in production build. | + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[buildCache?](./rspeedy.performance.buildcache.md) + + + + + + + +[BuildCache](./rspeedy.buildcache.md) \| boolean \| undefined + + + + +**_(BETA)_** _(Optional)_ Enable or configure persistent build cache. + +This feature is experimental and may be changed in the future. + + +
+ +[chunkSplit?](./rspeedy.performance.chunksplit.md) + + + + + + + +[ChunkSplit](./rspeedy.chunksplit.md) \| [ChunkSplitBySize](./rspeedy.chunksplitbysize.md) \| [ChunkSplitCustom](./rspeedy.chunksplitcustom.md) \| undefined + + + + +_(Optional)_ [Performance.chunkSplit](./rspeedy.performance.chunksplit.md) is used to configure the chunk splitting strategy. + + +
+ +[printFileSize?](./rspeedy.performance.printfilesize.md) + + + + + + + +PerformanceConfig\['printFileSize'\] \| undefined + + + + +_(Optional)_ Whether to print the file sizes after production build. + +[Performance.printFileSize](./rspeedy.performance.printfilesize.md) + +See [Rsbuild - performance.printFileSize](https://rsbuild.dev/config/performance/print-file-size) for details. + + +
+ +[profile?](./rspeedy.performance.profile.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ Whether capture timing information in the build time and the runtime, the same as the [profile](https://rspack.dev/config/other-options#profile) config of Rspack. + + +
+ +[removeConsole?](./rspeedy.performance.removeconsole.md) + + + + + + + +boolean \| [ConsoleType](./rspeedy.consoletype.md)\[\] \| undefined + + + + +_(Optional)_ Whether to remove `console.[methodName]` in production build. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.resolve.md b/docs/zh/api/rspeedy/rspeedy.resolve.md index 7253f1039..3899ca6c4 100644 --- a/docs/zh/api/rspeedy/rspeedy.resolve.md +++ b/docs/zh/api/rspeedy/rspeedy.resolve.md @@ -14,10 +14,120 @@ export interface Resolve ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [alias?](./rspeedy.resolve.alias.md) | | Record<string, string \| false \| string\[\]> \| undefined | _(Optional)_ Create aliases to import or require certain modules more easily. | -| [aliasStrategy?](./rspeedy.resolve.aliasstrategy.md) | | 'prefer-tsconfig' \| 'prefer-alias' \| undefined | _(Optional)_ Set the strategy for path alias resolution, to control the priority relationship between the paths option in tsconfig.json and the resolve.alias option of Rsbuild. - prefer-tsconfig (default): The paths option in tsconfig.json will take precedence over the resolve.alias option of Rsbuild. - prefer-alias: The resolve.alias option of Rsbuild will take precedence over the paths option in tsconfig.json. | -| [dedupe?](./rspeedy.resolve.dedupe.md) | | string\[\] \| undefined | _(Optional)_ Force to resolve the specified packages from project root, which is useful for deduplicating packages and reducing the bundle size. | -| [extensions?](./rspeedy.resolve.extensions.md) | | string\[\] \| undefined |

_(Optional)_ Automatically resolve file extensions when importing modules. This means you can import files without explicitly writing their extensions.

Default: ['.ts', '.tsx', '.mjs', '.js', '.jsx', '.json', '.cjs']

For example, if importing './index', Rsbuild will try to resolve using the following order:

- ./index.ts

- ./index.tsx

- ./index.mjs

- ./index.js

- ./index.jsx

- ./index.json

- ./index.cjs

| + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[alias?](./rspeedy.resolve.alias.md) + + + + + + + +Record<string, string \| false \| string\[\]> \| undefined + + + + +_(Optional)_ Create aliases to `import` or `require` certain modules more easily. + + +
+ +[aliasStrategy?](./rspeedy.resolve.aliasstrategy.md) + + + + + + + +'prefer-tsconfig' \| 'prefer-alias' \| undefined + + + + +_(Optional)_ Set the strategy for path alias resolution, to control the priority relationship between the `paths` option in `tsconfig.json` and the `resolve.alias` option of Rsbuild. - `prefer-tsconfig` (default): The `paths` option in `tsconfig.json` will take precedence over the `resolve.alias` option of Rsbuild. - `prefer-alias`: The `resolve.alias` option of Rsbuild will take precedence over the `paths` option in `tsconfig.json`. + + +
+ +[dedupe?](./rspeedy.resolve.dedupe.md) + + + + + + + +string\[\] \| undefined + + + + +_(Optional)_ Force to resolve the specified packages from project root, which is useful for deduplicating packages and reducing the bundle size. + + +
+ +[extensions?](./rspeedy.resolve.extensions.md) + + + + + + + +string\[\] \| undefined + + + + +_(Optional)_ Automatically resolve file extensions when importing modules. This means you can import files without explicitly writing their extensions. + +Default: `['.ts', '.tsx', '.mjs', '.js', '.jsx', '.json', '.cjs']` + +For example, if importing './index', Rsbuild will try to resolve using the following order: + +- `./index.ts` + +- `./index.tsx` + +- `./index.mjs` + +- `./index.js` + +- `./index.jsx` + +- `./index.json` + +- `./index.cjs` + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.server.md b/docs/zh/api/rspeedy/rspeedy.server.md index 87e0264d5..8c3feba04 100644 --- a/docs/zh/api/rspeedy/rspeedy.server.md +++ b/docs/zh/api/rspeedy/rspeedy.server.md @@ -14,14 +14,192 @@ export interface Server ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [base?](./rspeedy.server.base.md) | | string \| undefined | _(Optional)_ Configure the base path of the server. | -| [compress?](./rspeedy.server.compress.md) | | boolean \| CompressOptions \| undefined |

_(Optional)_ Configure whether to enable [gzip compression](https://developer.mozilla.org/en-US/docs/Glossary/gzip_compression) for static assets served by the dev server or preview server.

Default: true

See [Rsbuild - server.compress](https://rsbuild.rs/config/server/compress) for details.

| -| [cors?](./rspeedy.server.cors.md) | | ServerConfig\['cors'\] \| undefined |

_(Optional)_ Configure CORS for the dev server or preview server.

- Set to an object to enable CORS with the specified options.

- Set to true to enable CORS with the default options (allows all origins, not recommended).

- Set to false to disable CORS.

See [Rsbuild - server.cors](https://rsbuild.rs/config/server/cors) for details.

| -| [headers?](./rspeedy.server.headers.md) | | Record<string, string \| string\[\]> \| undefined | _(Optional)_ Adds headers to all responses. | -| [host?](./rspeedy.server.host.md) | | string \| undefined | _(Optional)_ Specify the host that the Rspeedy Server listens to. | -| [port?](./rspeedy.server.port.md) | | number \| undefined | _(Optional)_ Specify the port that the Rspeedy Server listens to. | -| [proxy?](./rspeedy.server.proxy.md) | | ProxyConfig \| undefined | _(Optional)_ Configure proxy rules for the dev server or preview server to proxy requests to the specified service. | -| [strictPort?](./rspeedy.server.strictport.md) | | boolean \| undefined |

_(Optional)_ When a port is occupied, Rspeedy will automatically increment the port number until an available port is found.

Set strictPort to true and Rspeedy will throw an exception when the port is occupied.

| + + + + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[base?](./rspeedy.server.base.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ Configure the base path of the server. + + +
+ +[compress?](./rspeedy.server.compress.md) + + + + + + + +boolean \| CompressOptions \| undefined + + + + +_(Optional)_ Configure whether to enable [gzip compression](https://developer.mozilla.org/en-US/docs/Glossary/gzip_compression) for static assets served by the dev server or preview server. + +Default: true + +See [Rsbuild - server.compress](https://rsbuild.rs/config/server/compress) for details. + + +
+ +[cors?](./rspeedy.server.cors.md) + + + + + + + +ServerConfig\['cors'\] \| undefined + + + + +_(Optional)_ Configure CORS for the dev server or preview server. + +- Set to an object to enable CORS with the specified options. + +- Set to `true` to enable CORS with the default options (allows all origins, not recommended). + +- Set to `false` to disable CORS. + +See [Rsbuild - server.cors](https://rsbuild.rs/config/server/cors) for details. + + +
+ +[headers?](./rspeedy.server.headers.md) + + + + + + + +Record<string, string \| string\[\]> \| undefined + + + + +_(Optional)_ Adds headers to all responses. + + +
+ +[host?](./rspeedy.server.host.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ Specify the host that the Rspeedy Server listens to. + + +
+ +[port?](./rspeedy.server.port.md) + + + + + + + +number \| undefined + + + + +_(Optional)_ Specify the port that the Rspeedy Server listens to. + + +
+ +[proxy?](./rspeedy.server.proxy.md) + + + + + + + +ProxyConfig \| undefined + + + + +_(Optional)_ Configure proxy rules for the dev server or preview server to proxy requests to the specified service. + + +
+ +[strictPort?](./rspeedy.server.strictport.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ When a port is occupied, Rspeedy will automatically increment the port number until an available port is found. + +Set strictPort to true and Rspeedy will throw an exception when the port is occupied. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.source.entry.md b/docs/zh/api/rspeedy/rspeedy.source.entry.md index 3513381a3..22792a7d0 100644 --- a/docs/zh/api/rspeedy/rspeedy.source.entry.md +++ b/docs/zh/api/rspeedy/rspeedy.source.entry.md @@ -12,6 +12,10 @@ The [Entry](./rspeedy.entry.md) option is used to set the entry module. entry?: Entry | undefined; ``` +## Default Value + +`'./src/index.js'` + ## Remarks If no value is provided, the default value `'./src/index.js'` will be used. diff --git a/docs/zh/api/rspeedy/rspeedy.source.md b/docs/zh/api/rspeedy/rspeedy.source.md index 8e87a6824..c5ce2eb95 100644 --- a/docs/zh/api/rspeedy/rspeedy.source.md +++ b/docs/zh/api/rspeedy/rspeedy.source.md @@ -14,16 +14,216 @@ export interface Source ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [alias?](./rspeedy.source.alias.md) | | Record<string, string \| false \| string\[\]> \| undefined | _(Optional)_ Create aliases to import or require certain modules more easily. | -| [assetsInclude?](./rspeedy.source.assetsinclude.md) | | Rspack.RuleSetCondition \| undefined | _(Optional)_ Include additional files that should be treated as static assets. Defaults to be undefined. | -| [decorators?](./rspeedy.source.decorators.md) | | [Decorators](./rspeedy.decorators.md) \| undefined | _(Optional)_ Used to configure the decorators syntax. | -| [define?](./rspeedy.source.define.md) | | Record<string, string \| number \| boolean \| undefined \| Record<string, unknown>> \| undefined | _(Optional)_ The define options is used to define some values or expressions at compile time. | -| [entry?](./rspeedy.source.entry.md) | | [Entry](./rspeedy.entry.md) \| undefined | _(Optional)_ The [Entry](./rspeedy.entry.md) option is used to set the entry module. | -| [exclude?](./rspeedy.source.exclude.md) | | Rspack.RuleSetCondition\[\] \| undefined | _(Optional)_ The source.exclude is used to specify JavaScript files that should be excluded from compilation. | -| [include?](./rspeedy.source.include.md) | | Rspack.RuleSetCondition\[\] \| undefined | _(Optional)_ The source.include is used to specify additional JavaScript files that need to be compiled. | -| [preEntry?](./rspeedy.source.preentry.md) | | string \| string\[\] \| undefined | _(Optional)_ Add a script before the entry file of each page. This script will be executed before the page code. It can be used to execute global logics, such as injecting polyfills, setting global styles, etc. | -| [transformImport?](./rspeedy.source.transformimport.md) | | [TransformImport](./rspeedy.transformimport.md)\[\] \| undefined | _(Optional)_ The [TransformImport](./rspeedy.transformimport.md) option transforms the import paths to enable modular imports from subpaths of third-party packages, similar to the functionality provided by [babel-plugin-import](https://npmjs.com/package/babel-plugin-import). | -| [tsconfigPath?](./rspeedy.source.tsconfigpath.md) | | string \| undefined | _(Optional)_ Configure a custom tsconfig.json file path to use, can be a relative or absolute path. Defaults to be ./tsconfig.json. | + + + + + + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[alias?](./rspeedy.source.alias.md) + + + + + + + +Record<string, string \| false \| string\[\]> \| undefined + + + + +_(Optional)_ Create aliases to `import` or `require` certain modules more easily. + + +
+ +[assetsInclude?](./rspeedy.source.assetsinclude.md) + + + + + + + +Rspack.RuleSetCondition \| undefined + + + + +_(Optional)_ Include additional files that should be treated as static assets. Defaults to be `undefined`. + + +
+ +[decorators?](./rspeedy.source.decorators.md) + + + + + + + +[Decorators](./rspeedy.decorators.md) \| undefined + + + + +_(Optional)_ Used to configure the decorators syntax. + + +
+ +[define?](./rspeedy.source.define.md) + + + + + + + +Record<string, string \| number \| boolean \| undefined \| Record<string, unknown>> \| undefined + + + + +_(Optional)_ The `define` options is used to define some values or expressions at compile time. + + +
+ +[entry?](./rspeedy.source.entry.md) + + + + + + + +[Entry](./rspeedy.entry.md) \| undefined + + + + +_(Optional)_ The [Entry](./rspeedy.entry.md) option is used to set the entry module. + + +
+ +[exclude?](./rspeedy.source.exclude.md) + + + + + + + +Rspack.RuleSetCondition\[\] \| undefined + + + + +_(Optional)_ The `source.exclude` is used to specify JavaScript files that should be excluded from compilation. + + +
+ +[include?](./rspeedy.source.include.md) + + + + + + + +Rspack.RuleSetCondition\[\] \| undefined + + + + +_(Optional)_ The `source.include` is used to specify additional JavaScript files that need to be compiled. + + +
+ +[preEntry?](./rspeedy.source.preentry.md) + + + + + + + +string \| string\[\] \| undefined + + + + +_(Optional)_ Add a script before the entry file of each page. This script will be executed before the page code. It can be used to execute global logics, such as injecting polyfills, setting global styles, etc. + + +
+ +[transformImport?](./rspeedy.source.transformimport.md) + + + + + + + +[TransformImport](./rspeedy.transformimport.md)\[\] \| undefined + + + + +_(Optional)_ The [TransformImport](./rspeedy.transformimport.md) option transforms the import paths to enable modular imports from subpaths of third-party packages, similar to the functionality provided by [babel-plugin-import](https://npmjs.com/package/babel-plugin-import). + + +
+ +[tsconfigPath?](./rspeedy.source.tsconfigpath.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ Configure a custom `tsconfig.json` file path to use, can be a relative or absolute path. Defaults to be `./tsconfig.json`. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.sourcemap.md b/docs/zh/api/rspeedy/rspeedy.sourcemap.md index b80a4193f..7ff28f60c 100644 --- a/docs/zh/api/rspeedy/rspeedy.sourcemap.md +++ b/docs/zh/api/rspeedy/rspeedy.sourcemap.md @@ -14,7 +14,45 @@ export interface SourceMap ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [js?](./rspeedy.sourcemap.js.md) | | Rspack.DevTool \| undefined \| \`${Exclude<Rspack.DevTool, false \| 'eval'>}-debugids\` | _(Optional)_ How the source map should be generated. Setting it to false will disable the source map. | + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[js?](./rspeedy.sourcemap.js.md) + + + + + + + +Rspack.DevTool \| undefined \| \`${Exclude<Rspack.DevTool, false \| 'eval'>}-debugids\` + + + + +_(Optional)_ How the source map should be generated. Setting it to `false` will disable the source map. + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.tools.md b/docs/zh/api/rspeedy/rspeedy.tools.md index b6291742e..6068182c9 100644 --- a/docs/zh/api/rspeedy/rspeedy.tools.md +++ b/docs/zh/api/rspeedy/rspeedy.tools.md @@ -14,12 +14,140 @@ export interface Tools ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [bundlerChain?](./rspeedy.tools.bundlerchain.md) | | ToolsConfig\['bundlerChain'\] \| undefined | _(Optional)_ The [Tools.bundlerChain](./rspeedy.tools.bundlerchain.md) changes the options of [Rspack](https://www.rspack.dev) using [rspack-chain](https://github.com/rspack-contrib/rspack-chain). | -| [cssExtract?](./rspeedy.tools.cssextract.md) | | [CssExtract](./rspeedy.cssextract.md) \| undefined | _(Optional)_ The [CssExtract](./rspeedy.cssextract.md) controls the options of [CssExtractRspackPlugin](https://www.rspack.dev/plugins/rspack/css-extract-rspack-plugin) | -| [cssLoader?](./rspeedy.tools.cssloader.md) | | [CssLoader](./rspeedy.cssloader.md) \| undefined | _(Optional)_ The [CssLoader](./rspeedy.cssloader.md) controls the options of [css-loader](https://github.com/webpack-contrib/css-loader). | -| [rsdoctor?](./rspeedy.tools.rsdoctor.md) | | [RsdoctorRspackPluginOptions](./rspeedy.rsdoctorrspackpluginoptions.md) \| undefined | _(Optional)_ The [Tools.rsdoctor](./rspeedy.tools.rsdoctor.md) controls the options of [Rsdoctor](https://rsdoctor.dev/). | -| [rspack?](./rspeedy.tools.rspack.md) | | ToolsConfig\['rspack'\] \| undefined | _(Optional)_ The [Tools.rspack](./rspeedy.tools.rspack.md) controls the options of [Rspack](https://www.rspack.dev/). | -| [swc?](./rspeedy.tools.swc.md) | | ToolsConfig\['swc'\] \| undefined | _(Optional)_ The [Tools.swc](./rspeedy.tools.swc.md) controls the options of [builtin:swc-loader](https://rspack.dev/guide/features/builtin-swc-loader). | + + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[bundlerChain?](./rspeedy.tools.bundlerchain.md) + + + + + + + +ToolsConfig\['bundlerChain'\] \| undefined + + + + +_(Optional)_ The [Tools.bundlerChain](./rspeedy.tools.bundlerchain.md) changes the options of [Rspack](https://www.rspack.dev) using [rspack-chain](https://github.com/rspack-contrib/rspack-chain). + + +
+ +[cssExtract?](./rspeedy.tools.cssextract.md) + + + + + + + +[CssExtract](./rspeedy.cssextract.md) \| undefined + + + + +_(Optional)_ The [CssExtract](./rspeedy.cssextract.md) controls the options of [CssExtractRspackPlugin](https://www.rspack.dev/plugins/rspack/css-extract-rspack-plugin) + + +
+ +[cssLoader?](./rspeedy.tools.cssloader.md) + + + + + + + +[CssLoader](./rspeedy.cssloader.md) \| undefined + + + + +_(Optional)_ The [CssLoader](./rspeedy.cssloader.md) controls the options of [css-loader](https://github.com/webpack-contrib/css-loader). + + +
+ +[rsdoctor?](./rspeedy.tools.rsdoctor.md) + + + + + + + +[RsdoctorRspackPluginOptions](./rspeedy.rsdoctorrspackpluginoptions.md) \| undefined + + + + +_(Optional)_ The [Tools.rsdoctor](./rspeedy.tools.rsdoctor.md) controls the options of [Rsdoctor](https://rsdoctor.dev/). + + +
+ +[rspack?](./rspeedy.tools.rspack.md) + + + + + + + +ToolsConfig\['rspack'\] \| undefined + + + + +_(Optional)_ The [Tools.rspack](./rspeedy.tools.rspack.md) controls the options of [Rspack](https://www.rspack.dev/). + + +
+ +[swc?](./rspeedy.tools.swc.md) + + + + + + + +ToolsConfig\['swc'\] \| undefined + + + + +_(Optional)_ The [Tools.swc](./rspeedy.tools.swc.md) controls the options of [builtin:swc-loader](https://rspack.dev/guide/features/builtin-swc-loader). + + +
diff --git a/docs/zh/api/rspeedy/rspeedy.transformimport.md b/docs/zh/api/rspeedy/rspeedy.transformimport.md index d917424d7..8fb1e6a98 100644 --- a/docs/zh/api/rspeedy/rspeedy.transformimport.md +++ b/docs/zh/api/rspeedy/rspeedy.transformimport.md @@ -14,11 +14,121 @@ export interface TransformImport ## Properties -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [camelToDashComponentName?](./rspeedy.transformimport.cameltodashcomponentname.md) | | boolean \| undefined | _(Optional)_ Whether to convert camelCase imports to kebab-case. | -| [customName?](./rspeedy.transformimport.customname.md) | | string \| undefined | _(Optional)_ Customize the transformed path. | -| [libraryDirectory?](./rspeedy.transformimport.librarydirectory.md) | | string \| undefined | _(Optional)_ Used to splice the transformed path, the splicing rule is ${libraryName}/${libraryDirectory}/${member}, where member is the imported member. | -| [libraryName](./rspeedy.transformimport.libraryname.md) | | string | The original import path that needs to be transformed. | -| [transformToDefaultImport?](./rspeedy.transformimport.transformtodefaultimport.md) | | boolean \| undefined | _(Optional)_ Whether to convert import statements to default imports. | + + + + + + +
+ +Property + + + + +Modifiers + + + + +Type + + + + +Description + + +
+ +[camelToDashComponentName?](./rspeedy.transformimport.cameltodashcomponentname.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ Whether to convert camelCase imports to kebab-case. + + +
+ +[customName?](./rspeedy.transformimport.customname.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ Customize the transformed path. + + +
+ +[libraryDirectory?](./rspeedy.transformimport.librarydirectory.md) + + + + + + + +string \| undefined + + + + +_(Optional)_ Used to splice the transformed path, the splicing rule is `${libraryName}/${libraryDirectory}/${member}`, where member is the imported member. + + +
+ +[libraryName](./rspeedy.transformimport.libraryname.md) + + + + + + + +string + + + + +The original import path that needs to be transformed. + + +
+ +[transformToDefaultImport?](./rspeedy.transformimport.transformtodefaultimport.md) + + + + + + + +boolean \| undefined + + + + +_(Optional)_ Whether to convert import statements to default imports. + + +
diff --git a/packages/lynx-compat-data/api-stats.json b/packages/lynx-compat-data/api-stats.json index 67f410b4b..cd0680c77 100644 --- a/packages/lynx-compat-data/api-stats.json +++ b/packages/lynx-compat-data/api-stats.json @@ -1,5 +1,5 @@ { - "generated_at": "2026-04-08T11:56:24.007Z", + "generated_at": "2026-04-11T06:38:22.363Z", "summary": { "total_apis": 1006, "platform_api_total": 917,