expo / snack

Expo Snack lets you run Expo in the browser.
https://snack.expo.dev
MIT License
373 stars 110 forks source link

The runtime does not package the babel helpers while snackager uses runtime-transform #299

Open mmomtchev opened 2 years ago

mmomtchev commented 2 years ago

Summary

My module exports a main and a module with the module using ES6 syntax which makes Babel to insert a couple of helpers:

yarn bundle @mmomtchev/react-native-settings@1.0.3 | ./node_modules/.bin/bunyan
file: /tmp/@mmomtchev/react-native-settings/web-bundle.js
--
externals: [
  "@babel/runtime/helpers/interopRequireDefault",
  "@babel/runtime/helpers/slicedToArray",
  "@react-navigation/native-stack",
  "react",
  "react-native"
]

What platform(s) does this occur on?

Web

SDK Version

v44.0.0

Reproducible demo or steps to reproduce from a blank project

https://snack.expo.dev/@mmomtchev/@mmomtchev-react-native-settings

mmomtchev commented 2 years ago

I was able to narrow the problem to that fact that my module has type: "module" and I was able to reproduce the problem outside of snackager with raw webpack and presets: [ 'module:metro-react-native-babel-preset']