I have been using Babel for a while now and it properly converts my ES Next code to the dist
folder with this command:
babel src --out-dir dist --source-maps --copy-files
So far I had all my Javascript code in src
, but now I want to move my React views to the views
folder next to src
. I modified the Babel CLI call to this:
babel src views --out-dir dist --source-maps --copy-files
Now my problem is that while the files are compiled properly none of the import
s are. For example in my file Navigation.js
I have this import
:
import Permissions from "../src/utils/permissions";
and this will get converted into
var _permissions = _interopRequireDefault(require("../src/utils/permissions"));
after Babel runs.
How do I configure Babel to fix the imports when I'm working with multiple source directories?