/
githubmirror
/
babel
Обзор
Документация
Войти
/
githubmirror
/
babel
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
scripts/integration-tests/e2e-react-native.sh
49 строк
2 KB
Nicolò Ribaudo
Remove Babel 7 from the codebase (#17618)
05 дек 2025, 14:33
05 дек 2025, 14:33
862d93d
Код
Авторство
О чём код?
#!/usr/bin/env bash #==============================================================================# # SETUP # #==============================================================================# # Start in scripts/integration-tests/ even if run from root directory cd "$(dirname "$0")" || exit root="$PWD" source utils/local-registry.sh source utils/cleanup.sh # Echo every command being executed set -x #==============================================================================# # ENVIRONMENT # #==============================================================================# node -v npm --version yarn --version #==============================================================================# # TEST # #==============================================================================# startLocalRegistry "$root"/verdaccio-config.yml # Create a React Native project cd /tmp YARN_ENABLE_IMMUTABLE_INSTALLS=false npx @react-native-community/cli init rnbabel cd rnbabel # Babel 8 adjustments # metro-react-native-babel-preset unconditionally enables the Flow plugin, even on TS files. # https://github.com/facebook/metro/blob/2c16fa67/packages/metro-react-native-babel-preset/src/configs/main.js#L25 npx replace '(?=\[require\("@babel/plugin-syntax-flow")' '//' node_modules/metro-react-native-babel-preset/src/configs/main.js # https://github.com/facebook/metro/blob/2c16fa67/packages/metro-react-native-babel-preset/src/configs/main.js#L169 npx replace '(?=plugins:.*?flow-strip-types)' 'exclude: [isTypeScriptSource, isTSXSource],' node_modules/metro-react-native-babel-preset/src/configs/main.js node "$root"/utils/bump-babel-dependencies.js resolutions # Build the project npm install npx react-native bundle --entry-file index.js --bundle-output output.js cleanup