babel-plugin-module-resolver icon indicating copy to clipboard operation
babel-plugin-module-resolver copied to clipboard

Doesn't respect --config-file when running babel from the cli

Open kyle-mccarthy opened this issue 5 years ago • 3 comments

I have two different babel config files, when I run babel for my server code I pass in a specific .babelrc-server file to the CLI option --config-file but this plugin will ignore that and use the default .babelrc file

kyle-mccarthy avatar Sep 15 '18 00:09 kyle-mccarthy

I'm having the same issue, I have a babel config for my Next project and another for my node server.

My solution for now was to add the root for the node project into the array of root directories in the original config.

You are correct though this will need to be fixed, but as a temporary solution this works :)

carwynstephen avatar Sep 17 '18 08:09 carwynstephen

@carwynstephen Coincidentally, I also getting this with a next setup, could you provide some additional info about what to add to the root in your config. Am I adding the root to the server side code? Do you still have two files or did you combine them into one?

kyle-mccarthy avatar Sep 24 '18 20:09 kyle-mccarthy

I have two files, my babelnoderc and .babelrc. I put my module resolver confic into .babelrc:

["module-resolver", { "root": [".", "./src"] }]

carwynstephen avatar Oct 11 '18 14:10 carwynstephen