Browse Source

rename script compile to build and add it to prepublish script

KaFai Choi 6 years ago
parent
commit
36bbad3977
2 changed files with 8 additions and 3 deletions
  1. 6
    3
      package.json
  2. 2
    0
      src/index.ts

+ 6
- 3
package.json View File

11
   "version": "2.12.1",
11
   "version": "2.12.1",
12
   "homepage": "https://github.com/react-native-community/react-native-webview#readme",
12
   "homepage": "https://github.com/react-native-community/react-native-webview#readme",
13
   "scripts": {
13
   "scripts": {
14
-    "compile": "tsc",
14
+    "prebuild": "rimraf lib",
15
+    "prepare": "yarn run build",
16
+    "build": "tsc",
15
     "ci:publish": "yarn semantic-release",
17
     "ci:publish": "yarn semantic-release",
16
-    "ci:test": "yarn ci:test:compile",
17
-    "ci:test:compile": "yarn compile",
18
+    "ci:test": "yarn ci:test:build",
19
+    "ci:test:build": "yarn build",
18
     "semantic-release": "semantic-release"
20
     "semantic-release": "semantic-release"
19
   },
21
   },
20
   "peerDependencies": {
22
   "peerDependencies": {
31
     "@types/react": "^16.4.18",
33
     "@types/react": "^16.4.18",
32
     "@types/react-native": "^0.57.6",
34
     "@types/react-native": "^0.57.6",
33
     "react-native": "^0.57",
35
     "react-native": "^0.57",
36
+    "rimraf": "^2.6.2",
34
     "semantic-release": "15.10.3",
37
     "semantic-release": "15.10.3",
35
     "typescript": "^3.1.6"
38
     "typescript": "^3.1.6"
36
   },
39
   },

+ 2
- 0
src/index.ts View File

3
 
3
 
4
 declare var _test1: typeof IOSWebView;
4
 declare var _test1: typeof IOSWebView;
5
 declare var _test2: typeof AndroidWebView;
5
 declare var _test2: typeof AndroidWebView;
6
+console.log('_test1', _test1)
7
+console.log('_test2', _test2)
6
 
8
 
7
 /// export to get the shape of the module
9
 /// export to get the shape of the module
8
 export default { WebView: IOSWebView}
10
 export default { WebView: IOSWebView}