Browse Source

add bundle tool

Paul 5 years ago
parent
commit
adc0bdae14
7 changed files with 2987 additions and 104 deletions
  1. 1
    0
      .gitignore
  2. 0
    15
      .vscode/tasks.json
  3. 4
    2
      package.json
  4. 1
    2
      public/index.html
  5. 2
    3
      src/example/main.ts
  6. 2
    1
      tsconfig.json
  7. 2977
    81
      yarn.lock

+ 1
- 0
.gitignore View File

@@ -1,2 +1,3 @@
1 1
 node_modules
2 2
 dist
3
+.cache

+ 0
- 15
.vscode/tasks.json View File

@@ -1,15 +0,0 @@
1
-{
2
-    // See https://go.microsoft.com/fwlink/?LinkId=733558
3
-    // for the documentation about the tasks.json format
4
-    "version": "2.0.0",
5
-    "tasks": [
6
-        {
7
-            "type": "typescript",
8
-            "tsconfig": "tsconfig.json",
9
-            "option": "watch",
10
-            "problemMatcher": [
11
-                "$tsc-watch"
12
-            ]
13
-        }
14
-    ]
15
-}

+ 4
- 2
package.json View File

@@ -4,13 +4,15 @@
4 4
   "description": "",
5 5
   "main": "index.js",
6 6
   "scripts": {
7
-    "test": "jest"
7
+    "test": "jest",
8
+    "start": "parcel public/index.html"
8 9
   },
9 10
   "author": "",
10 11
   "license": "ISC",
11 12
   "dependencies": {
12 13
     "crypto-js": "^3.1.9-1",
13
-    "node-int64": "^0.4.0"
14
+    "node-int64": "^0.4.0",
15
+    "parcel-bundler": "^1.12.3"
14 16
   },
15 17
   "devDependencies": {
16 18
     "@types/jest": "^24.0.11",

+ 1
- 2
public/index.html View File

@@ -1,7 +1,6 @@
1 1
 <!DOCTYPE html>
2
-
3 2
 <htm>
4 3
   <head>
5
-    <script src="../dist/example/main.js" type="text/javascript"></script>
4
+    <script src="../src/example/main.ts" type="text/javascript"></script>
6 5
   </head>
7 6
 </htm>

+ 2
- 3
src/example/main.ts View File

@@ -1,6 +1,5 @@
1
-import { Client } from "../index";
2 1
 
3
-console.log("Start")
2
+import { Client } from "../index";
4 3
 const client = new Client("ws://127.0.0.1:8081", null)
5 4
 
6
-console.log("client")
5
+console.log("test", "a")

+ 2
- 1
tsconfig.json View File

@@ -1,7 +1,8 @@
1 1
 {
2 2
   "compileOnSave": true,
3 3
   "compilerOptions": {
4
-    "module": "system",
4
+    "target": "es6",
5
+    "moduleResolution": "node",
5 6
     "alwaysStrict": true,
6 7
     "sourceMap": true,
7 8
     "declaration": true,

+ 2977
- 81
yarn.lock
File diff suppressed because it is too large
View File