0

I am import React-Native-Web into my project and I was transpiling it when my transpiling process ran into errors that I wasn't familiar with.

After reading through it I realized that the library was offering me a transpiled version of the code, even though that was not what I was expecting.

https://github.com/necolas/react-native-web/tree/master/packages/react-native-web

This is the source for the package, and in the .json file.

  • "module": "dist/index.js"
  • "main": "dist/cjs/index.js",

is there a way to tell npm which of these options to choose from?

Cody Jones
  • 424
  • 1
  • 5
  • 16

1 Answers1

1

You can do something like import ModuleName from '~/react-native-web/desired/path/to/file'.

You cant change the package json, because the changes wont be there when you npm install on other machine

Nikko Khresna
  • 1,024
  • 8
  • 10