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

build(rollupconfig): aliasing 적용 후 타입이 올바르게 생성되지 않던 문제를 수정 #668

Merged
merged 2 commits into from
Dec 15, 2021

Conversation

quino0627
Copy link
Contributor

@rollup/plugin-alias를 제거하고 rollup-plugin-typescript2 를 사용하게 수정

Summary

#649 이후로 빌드시 결과물에 type definition file이 올바르게 되어있지 않아 사용처에서 타입 오류를 발생시키던 문제를 해결합니다

Details

#649에서는 @rollup/plugin-alias를 사용하여 절대경로를 설정했습니다.
이전까지의 빌드 방식에서 문제가 발생했는데, typescript를 통하여 타입을 생성하는 과정은 rollup bundling보다 먼저 일어나기 때문에 생성된 defiition file들이 상대 경로가 아닌 절대 경로로 타입이 잡히게 되는 문제가 일어났습니다.
typescript 만으로는 이를 해결할 수 없기 때문에 다른 plugin을 사용하여 해결했습니다.

rollup-plugin-typescript2는 가장 대중적으로 쓰이는 plugin이고, 아래 코멘트를 참고하여 해결했습니다
ezolenko/rollup-plugin-typescript2#201 (comment)

다음과 같이 번들링과 type definition 파일들이 잘 나오고, ch-desk-web에 설치해서도 확인했습니다
image

Browser Compatibility

OS / Engine 호환성을 반드시 확인해주세요.

Windows

  • Chrome - Blink
  • Edge - Blink
  • Firefox - Gecko (Option)

macOS

  • Chrome - Blink
  • Edge - Blink
  • Safari - WebKit
  • Firefox - Gecko (Option)

References

@rollup/plugin-alias를 제거하고 rollup-plugin-typescript2 를 사용하게 수정
@quino0627 quino0627 self-assigned this Dec 15, 2021
@codecov
Copy link

codecov bot commented Dec 15, 2021

Codecov Report

Merging #668 (6846d0a) into next-v1 (612f134) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           next-v1     #668   +/-   ##
========================================
  Coverage    57.27%   57.27%           
========================================
  Files          152      152           
  Lines         2434     2434           
  Branches       684      684           
========================================
  Hits          1394     1394           
  Misses         938      938           
  Partials       102      102           
Impacted Files Coverage Δ
src/components/Avatars/Avatar/Avatar.tsx 56.52% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 612f134...6846d0a. Read the comment docs.

Comment on lines +30 to +40
exclude: [
'./src/index.ts',
'./src/components/Icon/generated/**/*',
'./src/layout/stories/**/*',
'**/*.stories.tsx',
'**/*.test.ts',
'**/*.test.tsx',
'./src/__mocks__/**/*',
'./src/utils/storyUtils.ts',
'./src/utils/testUtils.tsx',
],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

tsconfig.compile과 유사해 보이지만 tsconfig: tsconfig.compile.json 으로 설정하고 빌드 시 올바르게 동작하지 않습니다

Comment on lines +8 to +9
// eslint-disable-next-line no-restricted-imports
import defaultAvatarUrl from '../assets/defaultAvatar.svg'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

svg가 절대경로가 동작하지 않아 상대경로로 변경했습니다

Copy link
Contributor

@sungik-choi sungik-choi left a comment

Choose a reason for hiding this comment

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

🙇👍

@quino0627 quino0627 merged commit 8ea107b into channel-io:next-v1 Dec 15, 2021
@ch-builder
Copy link
Contributor

🎉 This PR is included in version 1.0.0-next-v1.66 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants