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/rspeedy/rspeedy.output.copy.md.
Rspeedy logo
Rspeedy
  • English
  • Home > @lynx-js/rspeedy > Output > copy

    Output.copy property

    The Output.copy option is used for copying files to the dist directory.

    Signature:

    copy?: Rspack.CopyRspackPluginOptions | Rspack.CopyRspackPluginOptions['patterns'] | undefined;

    Default Value

    undefined

    Remarks

    For more options, see Rspack.CopyRspackPlugin.

    Example 1

    • Copy files from ./src/assets to the ./dist directory:
    import { defineConfig } from '@lynx-js/rspeedy'
    
    export default defineConfig({
      output: {
        copy: [
          // `./src/assets/image.png` -> `./dist/image.png`
          { from: './src/assets' },
        ],
      },
    })

    Example 2

    • Copy files from ./src/assets to the ./dist/assets directory:
    import { defineConfig } from '@lynx-js/rspeedy'
    
    export default defineConfig({
      output: {
        copy: [
          // `./src/assets/image.png` -> `./dist/assets/image.png`
          { from: './src/assets', to: 'assets' },
        ],
      },
    })
    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.