Skip to content

tinchoz49/esbuild-plugin-copy-watch

Repository files navigation

esbuild-plugin-copy-watch

Esbuild plugin to copy and watch for files

Test Status JavaScript Style Guide standard-readme compliant

Install

$ npm install esbuild-plugin-copy-watch

Usage

import esbuild from 'esbuild'
import copy from 'esbuild-plugin-copy-watch'

await esbuild.build({
  entryPoints: ['src/index.js'],
  bundle: true,
  outfile: 'dest/build.js',
  write: false,
  plugins: [
    copy({
      paths: [
        { from: 'static/**', to: 'static' }, // will copy into dest/static
        { from: ['config/*.js', '!config/private.js'], to: 'config' } // will copy config files into dest/config and ignore the private.js
      ],
      forceCopyOnRebuild: false // force to copy the files in every rebuild
    })
  ]
})

Issues

🐛 If you found an issue we encourage you to report it on github. Please specify your OS and the actions to reproduce it.

Contributing

👥 Ideas and contributions to the project are welcome. You must follow this guideline.

License

MIT

About

Esbuild plugin to copy and watch for files

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published