fix(bundler): loader 미설정 에셋 silent failure + RN 프리셋 기본 로더#714
Merged
Conversation
loader=.none인 파일(예: .png)이 resolve되면 require_xxx() 리라이트는 생성되지만 실제 모듈 코드가 번들에 포함되지 않아 런타임 ReferenceError가 발생하던 버그 수정. - no_loader 에러 코드 추가 (esbuild 호환 진단) - --platform=react-native 시 Metro assetExts 호환 확장자에 file 로더 기본 할당 (이미지/폰트/미디어 19개, 사용자 --loader 오버라이드 우선) - 유닛 테스트 2개 + 통합 테스트 4개 추가 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Smoke Test Results (CI)Smoke Test Results
Size Comparison (ZTS vs esbuild)
Average ratio: 0.94x | Smaller: 122 | Similar(±10%): 1 | Larger: 8
|
Benchmark Results (CI)macos-latesttranspile — small (100 lines)
transpile — medium (1K lines)
transpile — large (5K lines)
bundle — small (10 modules)
bundle — medium (50 modules)
bundle — large (200 modules)
ubuntu-latesttranspile — small (100 lines)
transpile — medium (1K lines)
transpile — large (5K lines)
bundle — small (10 modules)
bundle — medium (50 modules)
bundle — large (200 modules)
windows-latesttranspile — small (100 lines)
transpile — medium (1K lines)
transpile — large (5K lines)
bundle — small (10 modules)
bundle — medium (50 modules)
bundle — large (200 modules)
|
플러그인이 에셋 파일(.png 등)에 대해 소스를 반환해도 parseAssetModule이 덮어쓰는 버그 수정. 플러그인이 소스를 반환하면: - module.loader를 .javascript로 변경하여 에셋 경로 스킵 - parseAssetModule은 module.source.len == 0일 때만 실행 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Metro의 기본 assetExts 전체를 RN 프리셋에 포함: - 이미지: bmp, gif, jpg, jpeg, png, psd, svg, webp, tiff, tif, xml - 비디오: m4v, mov, mp4, mpeg, mpg, webm - 오디오: aac, aiff, caf, m4a, mp3, wav - 문서: html, pdf, yaml, yml - 폰트: otf, ttf, woff, woff2 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- 유닛: ESM import 에셋 no-loader 에러, .mp3 no-loader 에러, 플러그인 없이 file 로더 동작 - 통합: RN 프리셋 .mp3 자동 처리, ESM import no-loader, loader=empty 동작 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
require_xxx()리라이트만 생성되고 모듈 코드가 번들에 누락되어 런타임ReferenceError발생하던 버그 수정no_loader에러 코드 추가로 esbuild 호환 진단 메시지 제공--platform=react-native시 MetroassetExts호환 확장자(이미지/폰트/미디어 19개)에file로더 기본 할당 (사용자--loader오버라이드 우선)Test plan
--loader:.png=file시 정상 번들 확인--loader:.png=fileCLI 성공--platform=react-native자동 처리--loader:.png=dataurl우선 확인🤖 Generated with Claude Code