For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/api/rspeedy/rspeedy.output.copy.md.
Rspeedy logo
Rspeedy
  • 简体中文
  • 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' },
        ],
      },
    })
    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。