Metro
https://gyazo.com/59aa544459dcacfad73d57cf071d490a
The JavaScript bundler for React Native
内部でBabelを使っている
Meta製
website
github
bundleのプロセスには3段階ある ref
resolution
entry pointから必要なmoduleのgraphをresolverを使って構築する
transformationと並行して実行される
transformation
transpile的なことをしてtagert platformで動く形式のJSに変換する
serialization
moduleを結合して1つまたは複数のbundleを生成する
#WIP
Metroのmodule解決
単なるbundlerではなく、他のこともやっている
bundler
JSをコンパイルする
applicationのassetsの管理
画像、フォント
serverの機能
開発時にリアルタイムでassetsを提供する
localhostを起動する
アプリが必要なJavaScriptファイルやアセットをリクエストすると、Metroがそれらを提供する
ref Expoがどう動くか
Getting Startedにserverの話が出てくる
ただのbundlerだと思っていると困惑する
expoを使っていると、この辺を意識することがない
metro.config.json
expo
@expo/metro-config
Introduction
Getting Started
Concepts
API Reference
Bundling API
Module API
Configuring Metro
https://metrobundler.dev/docs/configuration/
Metro CLI Options
Guides
Package Exports Support (Experimental)
Troubleshooting
Deep Dives
Bundle Formats
Caching
Module Resolution
https://metrobundler.dev/docs/resolution
Source Map Format