@andrewdicks/rollup-plugin-copy-files-plus
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

@andrewdicks/rollup-plugin-copy-files-plus

Copy files and folders (and optionally transform and rename them) during rollup bundling.

Installation

# yarn
yarn add @andrewdicks/rollup-plugin-copy-files-plus -D

# npm
npm install @andrewdicks/rollup-plugin-copy-files-plus -D

Usage

// rollup.config.js
import { RollupOptions } from "rollup";
import typescript from '@rollup/plugin-typescript';
import copyPlus from '@andrewdicks/rollup-plugin-copy-files';

export default {
  input: 'src/index.ts',
  output: {
    file: 'dist/index.mjs',
    format: 'esm'
  },
  plugins: [
    copyPlus({
      targets: [
        {
          basePath: '../../../some/relative/path',
          matchGlobs: [],
          ignoreGlobs: [],
          dest: './inside/dist/folder',
          flatten: false
        }
      ],
      dryRun: false
    })
  ]
}

Goals

  • Strongly-typed source code and published declarations
  • Easy-to-diagnose verbose output
  • ✴️ Safeguards around escaping the rollup destination
  • Able to copy from parent folders using relative paths without escaping the rollup destination
  • To support:
    • Structured copy
    • Flattened copy
    • 🔲 File renaming
    • 🔲 File content transformation (simple replacement, and also complex transformation)

Key

  • 🔲️ Not Started
  • ✴️ In Progress
  • Done
  • Cancelled

/@andrewdicks/rollup-plugin-copy-files-plus/

    Package Sidebar

    Install

    npm i @andrewdicks/rollup-plugin-copy-files-plus

    Weekly Downloads

    1

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    8.93 kB

    Total Files

    5

    Last publish

    Collaborators

    • andrewdicks