Skip to content

esbuild plugin for asynchronously creating/writing files in parallel

License

Notifications You must be signed in to change notification settings

ozanozbek/esbuild-plugin-write-file

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

esbuild plugin for asynchronously creating/writing files in parallel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published