Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 773 Bytes

File metadata and controls

30 lines (21 loc) · 773 Bytes
description Modern alternatives to the cpx package for copying file globs with watch mode

Replacements for cpx

cpx2

cpx is unmaintained. cpx2 is an actively maintained fork that keeps the same CLI bin name (cpx), so it works as a drop-in replacement for CLI usage. For the Node API, switch your import to cpx2.

npm i -D cpx # [!code --]
npm i -D cpx2 # [!code ++]

# CLI stays the same (bin name is still "cpx")
cpx "src/**/*.{html,png,jpg}" app --watch

Node API replacement:

const cpx = require('cpx') // [!code --]
const cpx = require('cpx2') // [!code ++]

cpx.copy('src/**/*.js', 'dist', (err) => {
  if (err) throw err
})