• Copy files and directories.

    Parameters

    Returns Plugin

    a vite plugin

    Example

    import { defineConfig } from 'vite';
    import cp from 'vite-plugin-cp';

    export default defineConfig({
    plugins: [
    cp({
    targets: [
    // copy files of './node_modules/vite/dist' to 'dist/test'
    { src: './node_modules/vite/dist', dest: 'dist/test' },

    // copy files of './node_modules/vite/dist' to 'dist/test2'
    // and keep the directory structure of copied files
    { src: './node_modules/vite/dist', dest: 'dist/test2', flatten: false },

    // copy './node_modules/vite/README.md' to 'dist'
    { src: './node_modules/vite/README.md', dest: 'dist' },
    ]
    })
    ]
    });

Generated using TypeDoc