rollup-plugin-mv
v0.0.2
Published
A Rollup plugin to move around generated files and directories
Downloads
4,209
Maintainers
Readme
rollup-plugin-mv
🍣 A Rollup plugin to move around generated files and directories
Requirements
This plugin requires an LTS Node version (v8.0.0+) and Rollup
Install
Using npm:
npm install rollup-plugin-mv --save-dev
Usage
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;
}
Options
overwrite
Type: boolean
Default: false
Overwrite existing file or directory.
once
Type: boolean
Default: false
Executes the move command only once even if there are multiple outputs.