Skip to content

Instantly share code, notes, and snippets.

@trooperandz
Last active July 6, 2023 05:00
Show Gist options
  • Save trooperandz/96fdca9e477b2a87311e1779e0317b51 to your computer and use it in GitHub Desktop.
Save trooperandz/96fdca9e477b2a87311e1779e0317b51 to your computer and use it in GitHub Desktop.
Alias path and module resolution babel setup
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