I'm currently running Babel with a simple command :
$ babel . --ignore node_modules --out-dir dist
But I can't find a way to ignore several directories (node_modules, test), I tried a lot of things, including (in .babelrc
):
"ignore": "node_modules" "ignore": "/node_modules/" "ignore": "node_modules/**" "ignore": ["node_modules"]
Which doesn't work at all (node_modules are transpiled). Isn't there a simple way to achieve this (with Babel 6)?
Try it via command line flag --ignore and you'll noticed the glob pattern is honored. I tried the workaround with CLI, and I just noticed that ' on both side of **/*. test.
The . babelrc file is your local configuration for your code in your project. Generally you would put it in the root of your application repo. It will affect all files that Babel processes that are in the same directory or in sibling directories of the . babelrc .
You should be able to use commas in the cli
babel . --ignore node_modules,test --out-dir dist
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With