For AI agents: the complete documentation index is available at /zh/llms.txt, the full documentation bundle is available at /zh/llms-full.txt, and this page is available as Markdown at /zh/api/rspeedy.output.inlinescripts.md.
这是开发预览网站。请访问正式文档 lynxjs.org

Home > @lynx-js/rspeedy > Output > inlineScripts

Output.inlineScripts property

The Output.inlineScripts option controls whether to inline scripts into Lynx bundle (.lynx.bundle).

Signature:

inlineScripts?: InlineChunkConfig | undefined;

Default Value

Rspeedy defaults this to true and only switches it to false when the user explicitly enables the top-level splitChunks option.

Remarks

This is different with output.inlineScripts since we normally want to inline scripts in Lynx bundle (.lynx.bundle).

There are two points that need to be especially noted:

  1. Only background thread scripts can remain non-inlined, whereas the main thread script is always inlined.

  2. Currently, when experimental_isLazyBundle is enabled, inlineScripts will always be true.

Example

Disable inlining background thread scripts.

import { defineConfig } from '@lynx-js/rspeedy'

export default defineConfig({
  output: {
    inlineScripts: false,
  },
})