npm.io
2.3.1 • Published 2 years ago

esbuild-plugin-copy-watch

Licence
MIT
Version
2.3.1
Deps
6
Size
23 kB
Vulns
0
Weekly
0
Stars
10

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

Keywords