For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/api/build/dev/write-to-disk.md.
Lynx
  • English
  • dev.writeToDisk

    optional writeToDisk?: boolean | ((filename: string) => boolean)

    Lynx default override

    This is an Rsbuild option whose default is overridden by pluginLynx. The default shown below applies when using the plugin. Set this option at the top level of rsbuild.config.ts; an explicit value takes precedence.

    See the Rsbuild reference for the full option behavior.

    Used to control whether the build artifacts of the development environment are written to the disk.

    Default Value

    true

    Remarks

    This is bypassed to `webpack-dev-middleware`.

    Setting writeToDisk: true won't change the behavior of the webpack-dev-middleware, and bundle files accessed through the browser will still be served from memory.

    This option also accepts a Function value, which can be used to filter which files are written to disk.

    The function follows the same premise as Array#filter in which a return value of false will not write the file, and a return value of true will write the file to disk.

    Example

    // lynx.config.ts
    import { defineConfig } from '@lynx-js/rspeedy'
    export default defineConfig({
      dev: {
        writeToDisk: (filePath) => /superman\.css$/.test(filePath),
      },
    })
    Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.