0.0.2 • Published 2 years ago

esbuild-plugin-copy-file v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

esbuild-plugin-copy-file

This esbuild plugin copies files (asynchronously and in parallel) before and after bundling.

Installation

npm install esbuild-plugin-copy-file

Usage

import esbuild from 'esbuild';
import copyFilePlugin from 'esbuild-plugin-copy-file';

esbuild.build({
  // ...
  plugins: [copyFilePlugin({
    before: { // copy before bundling
      './assets/favicon.png': './media/images/favicon.png'
    },
    after: { // copy after bundling
      './logs/build-report.json': './dist/report.json'
    }
  })]
});

Options

before: {String targetPath: String sourcePath, ...}

An object with targetPath: sourcePath entries. Files are copied before bundling.

after: {String targetPath: String sourcePath, ...}

An object with targetPath: sourcePath entries. Files are copied after bundling.