Add babel plugin to rewrite import paths

Replace 'react-native' imports with direct imports to the relevant
module within 'react-native-web'. Follow up task is to also rewrite
'react-native-web' imports from the entry file to become direct imports
(reduces bundle size).

Close #608
This commit is contained in:
Paul Armstrong
2017-08-17 08:45:43 -07:00
committed by Nicolas Gallagher
parent 641c8c47e0
commit 7e8ef5b72c
6 changed files with 341 additions and 304 deletions
+3 -2
View File
@@ -16,11 +16,11 @@
"docs:start": "cd docs && yarn && yarn start",
"docs:release": "cd docs && yarn release",
"flow": "flow",
"fmt": "find benchmarks docs src -name '*.js' | grep -v -E '(node_modules|dist)' | xargs yarn fmt:cmd",
"fmt": "find babel benchmarks docs src -name '*.js' | grep -v -E '(node_modules|dist)' | xargs yarn fmt:cmd",
"fmt:cmd": "prettier --print-width=100 --single-quote --write",
"jest": "jest",
"jest:watch": "yarn test -- --watch",
"lint": "yarn lint:cmd -- benchmarks docs src",
"lint": "yarn lint:cmd -- babel benchmarks docs src",
"lint:cmd": "eslint --ignore-path .gitignore --fix",
"precommit": "lint-staged",
"release": "yarn lint && yarn test && yarn compile && yarn build && npm publish",
@@ -72,6 +72,7 @@
"babel-core": "^6.26.0",
"babel-eslint": "^7.2.3",
"babel-loader": "^7.1.2",
"babel-plugin-tester": "^4.0.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.8",
"babel-preset-react-native": "^3.0.2",
"caniuse-api": "^2.0.0",