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;

Remarks

If no value is provided, the default value would be true, which means all background thread scripts will be inlined.

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,
  },
})
除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。