Back to results
Lazyuki/rollup-plugin-mv(opens in a new tab)
Language: TypeScript
Move files on the rollup output
- stars
- 3
- watchers
- 1
- forks
- 3
- open issues
- 0
- Last updated
- 05/31/2022
Language: TypeScript
Move files on the rollup output
🍣 A Rollup plugin to move around generated files and directories
This plugin requires an LTS Node version (v8.0.0+) and Rollup
Using npm:
npm install rollup-plugin-mv --save-dev
Create a rollup.config.js configuration file and import the plugin:
import mv from "rollup-plugin-mv"; export default { input: "src/index.js", output: { dir: "output", format: "cjs", }, plugins: [ mv( [ { src: "dist/file", dest: "dist/assets/file" }, { src: "dist/folder", dest: "dist/assets/dir", overwrite: true, }, ], { overwrite: false, } ), ], };
The first argument accepts an object or an array of objects with the following shape:
{ /** * Source file or directory */ src: string; /** * Destination file or directory */ dest: string; /** * Overwrite existing file or directory. */ overwrite?: boolean; }
Type: boolean
Default: false
Overwrite existing file or directory.
Type: boolean
Default: false
Executes the move command only once even if there are multiple outputs.