瀏覽代碼

rename script compile to build and add it to prepublish script

KaFai Choi 6 年之前
父節點
當前提交
36bbad3977
共有 2 個文件被更改,包括 8 次插入3 次删除
  1. 6
    3
      package.json
  2. 2
    0
      src/index.ts

+ 6
- 3
package.json 查看文件

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

+ 2
- 0
src/index.ts 查看文件

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