Module: @lynx-js/rsbuild-plugin
The Lynx build engine as an Rsbuild plugin. It builds a Lynx app with the Rsbuild CLI directly, without the Rspeedy CLI.
DSL plugins such as
pluginReactLynx
register the engine automatically when it is missing, so you only add
pluginLynx yourself to pass the options below. Rspeedy registers it for
you as well and forwards output.filename and performance.profile from
lynx.config.ts.
Example
Register the plugin next to a DSL plugin in rsbuild.config.ts. The
environment name (lynx below) becomes the [platform] placeholder of the
bundle filename, so the default output of this config is
dist/main.lynx.bundle.
Then use the Rsbuild CLI:
Remarks
To migrate from Rspeedy, replace rspeedy dev / rspeedy build with
rsbuild dev / rsbuild build, rename lynx.config.ts to
rsbuild.config.ts and import defineConfig from @rsbuild/core. The two
options Rspeedy used to forward to the engine are now passed to
pluginLynx directly:
Everything else in output, source, dev and server keeps the Rsbuild
shape and stays in rsbuild.config.ts. The engine applies Lynx-specific
defaults on top of the Rsbuild ones (bundle target, chunk loading, CSS
extraction, source maps) and only overrides a setting when another plugin
has not already set it.
Interfaces
- BundleFilenameContext
- LynxConfig
- LynxFilename
- LynxMinify
- LynxOutput
- LynxPerformance
- LynxPluginOptions