am using the command
npx babel-node --ignore=' ' --extensions='.ts,.tsx,.js,.jsx,.es6,.es' test.js
to compile the script named test.js .
test.js imports import template from 'lodash-es/template';
and I would like it to be compiled too.
Adding ignore or include or exclude options regex at babel.config.js doesn't work.
How do i add an inline --ignore
option ({ ignore: [/node_modules\/(?!lodash-es)/] }
) like babel.config.js?
Why does { ignore: [/node_modules\/(?!lodash-es)/] }
work with @babel/register
and not with babel.config.js
?
Below is test.js:
import fs from 'fs';
import template from 'lodash-es/template';
console.log(template);
export default function () {
};
package.json:
"@babel/cli": "^7.7.7",
"@babel/core": "^7.7.7",
"@babel/node": "^7.8.4",
Problem seems to be similar to https://github.com/facebook/jest/issues/6229