_Also posted in `expo publish fails when using an absolute path - Stack Overflow
I am using expo-cli 2.1.2.
I have defined an absolute path in my .babelrc file as following:
{
"presets": ["babel-preset-expo"],
"env": {
"development": {
"plugins": [
["transform-react-jsx-source"],
["module-resolver", {
"alias": {
"abs": "./src",
}
}]
]
}
}
}
I am able to build and test with this file. However, when I try to publish, the metro bundler fails to resolve the absolute path:
Unable to resolve "abs/services/firebaseInit" from "App.js"
Where App.js is in the top directory, and the failure is for the following line:
import firebaseInit from 'mypet/services/firebaseInit';
(firebaseInit
is defined in src\services\firebaseInit.js
)
Any idea how to solve this?