output.copy

  • Type: Rspack.CopyRspackPluginOptions | Rspack.CopyRspackPluginOptions['patterns']
  • Default: undefined

Copies the specified file or directory to the dist directory, implemented based on rspack.CopyRspackPlugin.

Please refer to the configuration options here: rspack.CopyRspackPlugin.

Example

Copy files from ./src/assets to the ./dist directory:

export default {
  output: {
    copy: [
      // `./src/assets/image.png` -> `./dist/image.png`
      { from: './src/assets' },
    ],
  },
};

Copy files from ./src/assets to the ./dist/assets directory:

export default {
  output: {
    copy: [
      // `./src/assets/image.png` -> `./dist/assets/image.png`
      { from: './src/assets', to: 'assets' },
    ],
  },
};
ON THIS PAGE