Skip to content
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

How to transpile dependencies with babel. #6

Open
dalcib opened this issue Jun 12, 2018 · 1 comment
Open

How to transpile dependencies with babel. #6

dalcib opened this issue Jun 12, 2018 · 1 comment

Comments

@dalcib
Copy link

dalcib commented Jun 12, 2018

@rafeca, thanks for this metro-sample-app.

I'm trying to use it with react-native-web,
I am using the following metro.config.js

module.exports = {
  extraNodeModules: {
    'react-native': 'node_modules/react-native-web'
  }
};

In order to get the extension .web.js to work in dev mode, I also changed the dev.html to:

...
<script src="http://localhost:8082/src/index.bundle?platform=web"></script>

adding ?platform=web at the and of the link.

The problem is when I import some react-native-xxx package, as react-native-vecttor-icons, for example, that is not compiled to ES5, or, for example, use ClassProperties, an error occurs.
In react-native-cli, these modules are transpiled automatically with babel.
Wich configuration should I use to get the same behavior in a web project?

@dalcib
Copy link
Author

dalcib commented Jul 26, 2018

@rafeca ?

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

No branches or pull requests

1 participant