{"id":22139,"library":"rollup-plugin-mv","title":"rollup-plugin-mv","description":"A Rollup plugin to move generated files and directories after the bundle is written. Version 0.0.2 is the current stable release; the plugin is minimal and has no updates yet. It provides a simple API to specify source and destination paths with optional overwrite and once flags. Compared to alternatives like rollup-plugin-copy or rollup-plugin-sh, it focuses exclusively on moving (not copying) and supports both files and directories. Includes TypeScript declarations.","status":"active","version":"0.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/Lazyuki/rollup-plugin-mv","tags":["javascript","rollup","plugin","rollup-plugin","mv","move","typescript"],"install":[{"cmd":"npm install rollup-plugin-mv","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-mv","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-mv","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default ESM import only. No named export exists.","wrong":"const { mv } = require('rollup-plugin-mv')","symbol":"mv","correct":"import mv from 'rollup-plugin-mv'"},{"note":"The package ships TypeScript types, but in CJS you must use require().default or dynamic import().","wrong":"const mv = require('rollup-plugin-mv').default","symbol":"mv","correct":"import mv from 'rollup-plugin-mv'"},{"note":"MoveConfig is a type-only export. Use import type to avoid runtime errors when using value imports.","wrong":"import { MoveConfig } from 'rollup-plugin-mv'","symbol":"type MoveConfig","correct":"import type { MoveConfig } from 'rollup-plugin-mv'"}],"quickstart":{"code":"// rollup.config.js\nimport mv from 'rollup-plugin-mv';\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    dir: 'dist',\n    format: 'cjs',\n  },\n  plugins: [\n    mv([\n      { src: 'dist/file.js', dest: 'dist/assets/file.js' },\n      { src: 'dist/folder', dest: 'dist/assets/folder', overwrite: true },\n    ], {\n      overwrite: false,\n      once: false,\n    }),\n  ],\n};","lang":"typescript","description":"Minimal Rollup configuration using rollup-plugin-mv to move files after build."},"warnings":[{"fix":"Use cross-device-aware tools or ensure source and destination are on the same filesystem.","message":"The plugin uses synchronous fs.renameSync under the hood, which fails if source and destination are on different filesystems (e.g., across drives on Windows).","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Use 'once: true' only when generating multiple outputs from a single config. For multiple plugin instances, consider using a flag or manual check.","message":"The 'once' option only works when there are multiple outputs in the Rollup config. It does not prevent multiple moves if the plugin is included multiple times.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Explicitly set overwrite: true or manually remove the destination before running Rollup.","message":"If the destination file or directory already exists and overwrite is false, the move silently fails (no error thrown).","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"search_vec":"'0.0.2':20 'altern':54 'api':39 'bundl':16 'compar':52 'copi':59,71 'current':23 'declar':80 'destin':44 'directori':13,77 'exclus':67 'file':11,75 'flag':51 'focus':66 'generat':10 'includ':78 'javascript':81 'like':55 'minim':29 'move':9,69,88 'mv':4,87 'option':47 'overwrit':48 'path':45 'plugin':3,7,27,58,63,83,86 'provid':36 'releas':25 'rollup':2,6,57,62,82,85 'rollup-plugin':84 'rollup-plugin-copi':56 'rollup-plugin-mv':1 'rollup-plugin-sh':61 'sh':64 'simpl':38 'sourc':42 'specifi':41 'stabl':24 'support':73 'typescript':79,89 'updat':33 'version':19 'written':18 'yet':34","created_at":"2026-04-27T17:03:35.567513+00:00","updated_at":"2026-04-27T17:03:35.567513+00:00","problems":[{"fix":"Ensure the source is generated before the plugin executes, or use a hook like 'writeBundle' (the plugin already uses 'generateBundle'). Check if the file path is correct.","cause":"Source file does not exist at the time the plugin runs (e.g., output generation order issue).","error":"Error: ENOENT: no such file or directory, rename 'dist/file' -> 'dist/assets/file'"},{"fix":"Use default import: import mv from 'rollup-plugin-mv'","cause":"Using a named import (import { mv } from ...) when the package only exports a default function.","error":"TypeError: mv is not a function"},{"fix":"Ensure each move entry has both 'src' and 'dest' strings: { src: '...', dest: '...' }","cause":"Passing an array with an object that lacks 'src' or 'dest' property.","error":"Error: src and dest are required"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/Lazyuki/rollup-plugin-mv","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/rollup-plugin-mv","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-18","next_check":"2026-07-26","install_tag":null}}