babel [...] --watch not working for building an es6 folder every time there is a change

1.8k Views Asked by At

I am creating a simple component library and would like to have it built every time I save one of my files.

This is what my current command looks like:

"watch": "babel components/ --out-dir dist --copy-files --ignore test.js --watch"

I have also moved the --watch flag around to see if it would make a difference and so far it does not make a difference and it only runs once.

For what it's worth, I am using @babel/cli v7.8.4. Anyway how could I get it to build every time I make a change? If so, what is wrong with my command?

1

There are 1 best solutions below

0
Y.Peng On

try follow:

"watch": "babel components --extensions .jsx --out-dir dist --copy-files --ignore test.js --watch"