babel-plugin-module-resolver
babel-plugin-module-resolver copied to clipboard
What am I missing?
Hello all,
I was trying to get Jest to work with my Node js application when I found out it could not find my aliases defined suing the package called "module-alias". Searching about this I found that aliases that are declared with babel-plugin-module-resolver would be found by Jest.
I do not know much about Babel, but I have installed babel-plugin-module-resolver, babel/core, babel/cli, babel/preset-env. Also, I have modified my package.json so now before running my node app, I run "babel src -d dist". Last but not least I have a babel.config.js with the following content:
module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current',
},
},
],
],
plugins : [
[
"babel-plugin-module-resolver",
{
root : ["./core/"],
alias: {
"@auth": "auth",
"@errorManager": "./core/errorManager",
}
}]
]
};
Right now I am not even running Jest, but it does not find the aliases at all. What I am missing?
Thank you in advance and regards.