-
Notifications
You must be signed in to change notification settings - Fork 0
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
Configure TypeScript Paths #11
Conversation
72ed96a
to
e26c6a0
Compare
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
e26c6a0
to
b85fd7f
Compare
b85fd7f
to
1e38004
Compare
1e38004
to
1a90338
Compare
2e32be8
to
ee4756a
Compare
ee4756a
to
83a77db
Compare
83a77db
to
0a1feb5
Compare
0a1feb5
to
ce65e84
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #11 +/- ##
========================================
Coverage 17.24% 17.24%
========================================
Files 4 4
Lines 29 29
Branches 4 4
========================================
Hits 5 5
Misses 21 21
Partials 3 3 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good Job
package.json
Outdated
@@ -46,6 +46,7 @@ | |||
"tailwindcss": "^3.4.3", | |||
"typescript": "^5.2.2", | |||
"vite": "^5.2.0", | |||
"vite-tsconfig-paths": "^4.3.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where did you use this package?
src/main.tsx
Outdated
@@ -1,6 +1,6 @@ | |||
import React from 'react'; | |||
import ReactDOM from 'react-dom/client'; | |||
import App from './App.tsx'; | |||
import App from 'src/App.tsx'; | |||
import './index.css'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't you use the absolute import here?
src/main.tsx
Outdated
@@ -1,6 +1,6 @@ | |||
import React from 'react'; | |||
import ReactDOM from 'react-dom/client'; | |||
import App from './App.tsx'; | |||
import App from 'src/App.tsx'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to import like import App from @/App.tsx
tsconfig.json
Outdated
|
||
"baseUrl": ".", | ||
"paths": { | ||
"@src/*": ["src/*"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use "@/*": ["./src/*" ]
vite.config.ts
Outdated
@@ -17,4 +18,14 @@ export default defineConfig({ | |||
environment: 'jsdom', | |||
setupFiles: ['./src/__test__/setupTests.ts'], | |||
}, | |||
resolve: { | |||
alias: { | |||
'@': path.resolve(__dirname, 'src'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use like "@": path.resolve(__dirname, "./src"),
ce65e84
to
d006611
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!!!
d006611
to
6348fb0
Compare
- update vite config - set up docker [Finishes #10]
6348fb0
to
4b9e2b4
Compare
What does this PR do?
This PR sets up a new React project path aliases for TypeScript in a React project using Vite, making imports cleaner and more manageable for efficient development.
Description of Task to be Completed?