0.0.4 • Published 2 years ago

esbuild-plugin-write-file v0.0.4

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

esbuild-plugin-write-file

This esbuild plugin creates/writes files (asynchronously and in parallel) before and after bundling.

Installation

npm install esbuild-plugin-write-file

Usage

import esbuild from 'esbuild';
import writeFilePlugin from 'esbuild-plugin-write-file';

esbuild.build({
  // ...
  plugins: [writeFilePlugin({
    before: { // write before bundling
      './src/template.html': 'template content',
      './src/license.txt': 'license content'
    },
    after: { // write after bundling
      './dist/report.json': JSON.stringify({hello: 'world'})
    }
  })]
});

Options

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

An object with targetPath: content entries. Files are written before bundling.

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

An object with targetPath: content entries. Files are written after bundling.

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago