UNPKG

@web/rollup-plugin-copy

Version:

Rollup plugin which copies asset files while retaining the relative folder structure.

25 lines 1.07 kB
/** * Copies all files from the given patterns retaining relative paths relative to the root directory. * * @example * // Copy all svg, jpg and json files * copy({ patterns: '**\/*.{svg,jpg,json}' }) * // Copy svg files from two different folders * copy({ patterns: ['icons\/*.svg', 'test/icons\/*.svg'] }) * // Copy all svg files relative to given rootDir * copy({ patterns: '**\/*.svg', rootDir: './my-path/' }) * // you can combine it with path.resolve * copy({ patterns: '**\/*.svg', rootDir: path.resolve('./my-path/') }) * * @param {object} options * @param {string|string[]} options.patterns Single glob or an array of globs * @param {string|string[]} options.exclude Single glob or an array of globs * @param {string} [options.rootDir] Defaults to current working directory * @return {import('rollup').Plugin} A Rollup Plugin */ export function copy({ patterns, rootDir, exclude }: { patterns: string | string[]; exclude: string | string[]; rootDir?: string | undefined; }): import("rollup").Plugin; //# sourceMappingURL=copy.d.ts.map