Getting error when using --ignore with babel-node, but not with babel


#1

High level issue: the ignore flag seems to be working incorrectly when used in conjunction with babel-node, but not when used with plain babel. Any thoughts on why this might happen?

Details

When I run the following command:

BABEL_ENV=node NODE_ENV=development npx babel-node ./src/index.js --ignore='./node_modules/([email protected])'

I get this error:

Error: Options {"loose":true} passed to /path/to/working/directory/node_modules/babel-preset-env/lib/index.js which does not accept options. (While processing preset: "/path/to/working/directory/node_modules/babel-preset-env/lib/index.js") (While processing preset: "/path/to/working/directory/compare/node_modules/babel-preset-env/lib/index.js") (While processing preset: "/path/to/working/directory/node_modules/babel-preset-react/lib/index.js")
    at /path/to/working/directory/node_modules/babel-core/lib/transformation/file/options/option-manager.js:314:17

However, if I run this command:

BABEL_ENV=node NODE_ENV=development npx babel . --ignore='./node_modules/([email protected])' --ignore="./lib/" --out-dir=lib

The compilation seems to be fine.

Environment Information:
OSX Sierra, NPM 5-latest, Node 8.7.0, using latest version of babel-cli and all presets