Last active
July 6, 2023 05:00
-
-
Save trooperandz/96fdca9e477b2a87311e1779e0317b51 to your computer and use it in GitHub Desktop.
Alias path and module resolution babel setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
presets: ['@babel/preset-react', 'jest'], | |
plugins: [ | |
[ | |
'module-resolver', | |
{ | |
root: ['./src'], | |
extensions: ['.js', '.jsx', '.json', '.svg', '.png'], | |
// Note: you do not need to provide aliases for same-name paths immediately under /src/ | |
alias: { | |
auth: './src/features/auth', | |
tasks: './src/features/tasks', | |
} | |
} | |
] | |
] | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment