Skip to content

Commit

Permalink
✨ Adding import alias support
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbrentkelly committed Apr 5, 2021
1 parent 7b7b8fd commit c04ae4a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# :space_invader: Enhanced TypeScript Template for Expo!

**TypeScript + ESLint + Prettier + VSCode**
**TypeScript + ESLint + Prettier + VSCode + Import aliases + Helpful yarn scripts**

```bash
npx crna --template https://github.com/mrbrentkelly/expo-template-bk
Expand Down
Empty file added app/components/.keep
Empty file.
22 changes: 21 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
module.exports = function (api) {
api.cache(true);
return {
presets: ["babel-preset-expo"],
presets: ['babel-preset-expo'],
plugins: [
[
'module-resolver',
{
root: ['./'],
extensions: [
'.ios.ts',
'.android.ts',
'.ts',
'.ios.tsx',
'.android.tsx',
'.tsx',
'.json',
],
alias: {
'@components': './app/components',
},
},
],
],
};
};
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"scripts": {
"nuke": "rm -rf node_modules"
},
"dependencies": {
"expo": "~40.0.0",
"react": "16.13.1",
Expand All @@ -12,6 +15,7 @@
"@react-native-community/eslint-config": "^2.0.0",
"@types/react": "~16.9.35",
"@types/react-native": "~0.63.2",
"babel-plugin-module-resolver": "^4.1.0",
"eslint": "^7.14.0",
"typescript": "~4.0.0",
"vscode-project-react-native": "^0.2.0"
Expand Down

0 comments on commit c04ae4a

Please sign in to comment.