Skip to content

feat/js bundle 참조 위치를 cdn 경로로 변경 #166

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

Draft
wants to merge 6 commits into
base: ios
Choose a base branch
from

Conversation

salmonco
Copy link
Collaborator

@salmonco salmonco commented Apr 29, 2025

작업 분류

  • 기능 추가
  • QA 반영
  • 리팩토링

요구사항

  • code push 환경 구축

작업 내용

트러블슈팅

TODO

  • 이미지 등 정적 리소스도 CDN 에 올려서 참조하게 하기 -> require(...) 로 참조하던 것을 외부 url 바라보도록 경로 변경해야 함
  • ios 배포 이후 진행

테스트

@salmonco salmonco requested a review from obb8923 April 29, 2025 14:32
@salmonco salmonco self-assigned this Apr 29, 2025
@salmonco salmonco marked this pull request as draft April 29, 2025 17:07
@salmonco salmonco marked this pull request as ready for review April 30, 2025 14:43
package.json Outdated
Comment on lines 15 to 17
"bundle:android": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output dist/android/index.android.bundle --assets-dest dist/android/assets",
"bundle:ios": "react-native bundle --platform ios --dev false --entry-file index.js --bundle-output dist/ios/index.ios.bundle --assets-dest dist/ios/assets",
"bundle": "yarn bundle:android && yarn bundle:ios"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

추후 js 코드 변경 시 -> yarn bundle 명령어 실행 -> dist 폴더에 추출된 js bundle 파일과 assets 를 CDN 에 업로드하는 방식입니다.

Comment on lines +43 to +45
// return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
// Code Push via CDN
return [NSURL URLWithString:@"https://ip-file-upload-test.s3.ap-northeast-2.amazonaws.com/naeilmorae-bundle/index.ios.bundle"];
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ios 에서 외부 js bundle 파일을 참조하게 했습니다.

Comment on lines +23 to +32
// Code Push via CDN
override fun getJSBundleFile(): String? {
return if (BuildConfig.DEBUG) {
// 디버그 모드일 때는 null 반환해서 Metro 서버 연결
null
} else {
// 릴리즈 모드일 때는 CDN 번들 사용
"https://ip-file-upload-test.s3.ap-northeast-2.amazonaws.com/naeilmorae-bundle/index.android.bundle"
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

안드로이드에서 외부 js bundle 파일을 참조하게 했습니다.

@salmonco salmonco marked this pull request as draft April 30, 2025 15:17
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.

1 participant