Skip to content

Commit

Permalink
Config alias path
Browse files Browse the repository at this point in the history
  • Loading branch information
MehdiKhoshnevisz committed Jun 14, 2022
1 parent f5797ba commit b3dceb7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
9 changes: 9 additions & 0 deletions craco.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const path = require("path");

module.exports = {
webpack: {
alias: {
"@": path.resolve(__dirname, "src"),
},
},
};
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"start": "craco start",
"build": "craco build",
"test": "craco test",
"eject": "craco eject",
"deploy": "npm run build && gh-pages -d build"
},
"eslintConfig": {
Expand Down
11 changes: 3 additions & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
Expand All @@ -20,7 +16,6 @@
"noEmit": true,
"jsx": "react-jsx"
},
"include": [
"src"
]
"include": ["src"],
"extends": "./tsconfig.paths.json"
}
8 changes: 8 additions & 0 deletions tsconfig.paths.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
}
}

0 comments on commit b3dceb7

Please sign in to comment.