-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module resolver support? #3
Comments
Nice suggestion, if you are interested to help, I would be extremely glad if you are interested to add this feature to the repo.
"components": "file:./app/src/components",
resolve: {
alias: {
"components": "file:./app/src/components",
}
}
{
"plugins": [
["babel-plugin-module-resolver", {
"alias": {
"components": "file:./app/src/components",
}
}]
]
} Reminder for future reference How to do it
This should be done in
|
Do we have to pass in any options to get this to work on v1.2.2? It seems to not be working by default for me with It could be because of other things I have going on: e.g. Typescript, React Native etc |
Same issue here, i'm using My babel configuration: module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
[
'module-resolver',
{
extensions: [
'.ios.ts',
'.android.ts',
'.ts',
'.ios.tsx',
'.android.tsx',
'.tsx',
'.jsx',
'.js',
'.json',
],
alias: {
'@components': './src/components',
'@constants': './src/constants',
'@screens': './src/screens',
'@contexts': './src/contexts',
'@reducers': './src/reducers',
'@locales': './src/locales',
'@helpers': './src/helpers',
'@api': './src/services/ApiService.js',
},
},
],
],
}; |
Hey,
First of all thanks for this awesome lib! It's really good =)
I wonder if we could add babel.js module-resolver support - in order to support absolute imports.
For example I have this setup in my project:
Thanks to module-resolver I don't have to do
../../../components/Loading/FadeIn
, since it simplifies that by allowing me to directly targetcomponents
folder.But due to module-resolver, deadfile doesn't recognise that the component is being imported:
Any ideas? I'm willing to contribute to this project. 😃
The text was updated successfully, but these errors were encountered: