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

  "presets": ["es2015"],
  "ignore": [

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.

  • assuming .babelrc and your src folder sit in the same parent folder, you perhaps need to supply "ignore": ["src/**"] or "ignore": [/src/] to it. – Tahir Ahmed Dec 24 '15 at 3:44
  • I've tried that, but have had no success – Yann Bertrand Dec 28 '15 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 May 18 '16 at 1:33
  • 1
    Possible duplicate of Babel ignore several directories – Wilfred Hughes Sep 23 '16 at 18:45
  • 1
    The issue on GitHub is closed right now. You can verify and mark this question as answered! – Aftab Khan Jun 28 '17 at 18:29

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

| improve this answer | |

Your Answer

