Skip to content
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

[#35] path aliases 설정 #36

Merged
merged 3 commits into from
Jan 4, 2024
Merged

[#35] path aliases 설정 #36

merged 3 commits into from
Jan 4, 2024

Conversation

im-na0
Copy link
Contributor

@im-na0 im-na0 commented Jan 4, 2024

Issue Number

close #35

⛳️ Task

  • 화이팅하기
  • path aliases 설정

✍️ Note

    "paths": {
      "@/*": ["./src/*"],
      "@components/*": ["./src/components/*"],
      "@hooks/*": ["./src/hooks/*"],
      "@pages/*": ["./src/pages/*"],
      "@styles/*": ["./src/styles/*"],
      "@constants/*": ["./src/constants/*"],
      "@assets/*": ["./src/assets/*"],
      "@api/*": ["./src/api/*"],
      "@mocks/*": ["./src/mocks/*"],
      "@routes/*": ["./src/routes/*"],
      "@utils/*": ["./src/utils/*"],
      "@type/*": ["./src/types/*"]
    }

📸 Screenshot

📎 Reference

@im-na0 im-na0 added the CHORE Further information is requested label Jan 4, 2024
@im-na0 im-na0 self-assigned this Jan 4, 2024
Copy link

github-actions bot commented Jan 4, 2024

Visit the preview URL for this PR (updated for commit 0d4f087):

https://percenthotel--pr36-feature-35-path-ali-guydc4yy.web.app

(expires Thu, 11 Jan 2024 04:51:57 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 5f3aee9d8d8535dbb552ad12361bc813c5a90573

@im-na0 im-na0 changed the title path aliases 설정 [#35] path aliases 설정 Jan 4, 2024
@wowba
Copy link
Contributor

wowba commented Jan 4, 2024

사용 방법은 import *** from "@pages/***" 처럼 쓰면 되는건가요?

@im-na0
Copy link
Contributor Author

im-na0 commented Jan 4, 2024

사용 방법은 import *** from "@pages/***" 처럼 쓰면 되는건가요?

넵 맞습니다!

Copy link
Contributor

@wowba wowba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alias를 써본적이 없는데, 폴더 구조가 크게 변하지 않는 이상 유용할 것 같습니다!

Copy link
Contributor

@Bumang-Cyber Bumang-Cyber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이렇게 절대경로로 사용하는거 좋습니다. 수고하셨습니다!
그런데 나중에 vitest쓸 때 얘가 alias 알아먹게 해주는거 세팅해줘야하나봐요.
그것만 유의하면 괜찮을거 같습니다!

@im-na0
Copy link
Contributor Author

im-na0 commented Jan 4, 2024

vitest

오옹 vitest 를 사용하려면 따로 alias 설정해줘야하군용
이슈 공유주셔서 감사합니다!!!👍

https://vitest.dev/guide/common-errors#cannot-find-module-relative-path
이 아티클에 나와있는대로 vitest에서도 path alias 사용하도록 설정해주니 제대로 import 되는걸 확인했습니다 ^.^
해당 부분 추가했습니다

Copy link
Contributor

@chaeminseok chaeminseok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alias써본적은 없는데 path가 더 직관적이여서 좋네요. 세팅감사합니다

@im-na0 im-na0 merged commit 4d2fc8b into main Jan 4, 2024
3 checks passed
@im-na0 im-na0 deleted the feature/#35-path-alias branch January 4, 2024 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CHORE Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

path alias 설정
4 participants