17

I've got a .babelrc file at the root of a project:

{
  "presets": ["es2015"],
  "ignore": [
    "src"
  ]
}

When I compile it with babel src --out-dir dist, the src folder is still compiled onto the dist folder.

However, when I launch the command babel src --out-dir dist --ignore src, nothing is compiled.

Why is the ignore property of my .babelrc being ignored?

By the way, I've tried with some subfolder or files, and the same issue occurs.

6
  • assuming .babelrc and your src folder sit in the same parent folder, you perhaps need to supply "ignore": ["src/**"] or "ignore": [/src/] to it. Commented Dec 24, 2015 at 3:44
  • I've tried that, but have had no success Commented Dec 28, 2015 at 21:30
  • 3
    There's an active bug reported for this issue btw in case you were pulling out your hair like I was.
    – shriek
    Commented May 18, 2016 at 1:33
  • 1
    Possible duplicate of Babel ignore several directories Commented Sep 23, 2016 at 18:45
  • 1
    The issue on GitHub is closed right now. You can verify and mark this question as answered!
    – Aftab Khan
    Commented Jun 28, 2017 at 18:29

1 Answer 1

0

This was an issue with babel-cli.

It has been fixed in v6.14.0. Here is the changelog for this version: https://github.com/babel/babel/releases/tag/v6.14.0

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.