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;

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.