[fix] babel-plugin only rewrites paths for known modules

Don't rewrite import paths for non-existent modules or types. They will
attempt to be imported from the package's main export. This change
currently requires a module map to be generated for the babel-plugin to
use. The map is automatically regenerated for any commit that alters the
entry file of react-native-web.

Fix #822
This commit is contained in:
Nicolas Gallagher
2018-02-19 12:34:32 -08:00
parent 239a43978f
commit a53372ceb3
5 changed files with 92 additions and 2 deletions
+3
View File
@@ -62,6 +62,9 @@
"fmt:cmd",
"git update-index --again",
"eslint"
],
"packages/react-native-web/src/index.js": [
"node ./scripts/babel/createModuleMap.js"
]
},
"prettier": {