Cohars Cohars - 1 year ago 261
Javascript Question

Babel ignore several directories

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

"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)?

Answer Source

You should be able to use commas in the cli

babel . --ignore node_modules,test --out-dir dist

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download