External imports in Babel 7 do not get transpiled
I've managed to fix this by following this comment.
The solution is:
- Move
.babelrc
in the main project tobabel.config.js
and make it a CommonJS module - Add
--ignore=node_modules
when runningbabel-node
from the main project
This still seems pretty hacky and Babel doesn't seem to acknowledge the ignore
property within babel.config.js
it must be specified as a flag.
Babel 7 appears to only allow imports within the directory the babel config is in, however explicitly setting the --ignore
flag overrides this.
You can view my working demo and the diff of what I changed to get it working.
The issue is still open on GitHub so there may be a better solution in the future.