Browse Source

werks

master
Daniel Hübleitner 4 years ago
parent
commit
b39b9347ed
5 changed files with 19 additions and 86 deletions
  1. 7
    0
      Index.ts
  2. 8
    8
      package.json
  3. 3
    30
      src/webpack.js
  4. 0
    47
      test/webpack.js
  5. 1
    1
      tsconfig.json

+ 7
- 0
Index.ts View File

1
+import * as Back from './src/Backend';
2
+import * as Front from './src/Frontend';
3
+
4
+export {
5
+    Back as Backend,
6
+    Front as Frontend
7
+}

+ 8
- 8
package.json View File

1
 {
1
 {
2
   "name": "rpclibrary",
2
   "name": "rpclibrary",
3
-  "version": "1.0.2",
3
+  "version": "1.0.3",
4
   "description": "",
4
   "description": "",
5
+  "main": "./js/Index.js",
5
   "scripts": {
6
   "scripts": {
6
     "tsc": "tsc",
7
     "tsc": "tsc",
7
-    "webpack": "webpack",
8
-    "build-lib": "webpack --config ./src/webpack.js",
9
-    "build-test": "webpack --config ./test/webpack.js",
10
-    "build": "npm run clean && npm run build-lib && npm run build-test && mv js/**/*.d.ts .",
11
-    "clean": "rm -rf ./*.js ./*.d.ts js"
8
+    "webpack": "webpack --config ./src/webpack.js",
9
+    "backend": "node js/test/TestBackend.js",
10
+    "frontend": "node js/test/TestFrontend.js",
11
+    "build": "npm run clean && tsc && npm run webpack",
12
+    "clean": "rm -rf js"
12
   },
13
   },
13
   "author": "",
14
   "author": "",
14
   "license": "ISC",
15
   "license": "ISC",
29
     "uuid": "^3.3.3"
30
     "uuid": "^3.3.3"
30
   },
31
   },
31
   "files": [
32
   "files": [
32
-    "*.js",
33
-    "*.d.ts"
33
+    "js"
34
   ]
34
   ]
35
 }
35
 }

+ 3
- 30
src/webpack.js View File

3
 const frontendConf = {
3
 const frontendConf = {
4
   mode: 'production',
4
   mode: 'production',
5
   target: "web",
5
   target: "web",
6
-  entry: path.resolve(__dirname, 'Frontend.ts'),
6
+  entry: path.resolve(__dirname, '..', 'js', 'src', 'Frontend.js'),
7
   output: {
7
   output: {
8
-      path: path.resolve(__dirname, '..'),
8
+      path: path.resolve(__dirname, '..', 'js', 'src'),
9
       filename: "Frontend.js",
9
       filename: "Frontend.js",
10
       libraryTarget: 'commonjs',
10
       libraryTarget: 'commonjs',
11
   },
11
   },
12
-  module: {
13
-    rules: [
14
-      { test: /\.ts?$/, loader: "ts-loader" }
15
-    ]
16
-  },
17
-  resolve: {
18
-    extensions: [".ts", ".tsx", ".js"]
19
-  },
20
-  optimization: {
21
-    minimize: true,
22
-  },
23
-}
24
-
25
-const backendConf = {
26
-  mode: 'production',
27
-  target: "node",
28
-  entry: path.resolve(__dirname, 'Backend.ts'),
29
-  output: {
30
-      path: path.resolve(__dirname, '..'),
31
-      filename: "Backend.js",
32
-      libraryTarget: 'commonjs'
33
-  },
34
-  module: {
35
-    rules: [
36
-      { test: /\.ts?$/, loader: "ts-loader" }
37
-    ]
38
-  },
39
   resolve: {
12
   resolve: {
40
     extensions: [".ts", ".tsx", ".js"]
13
     extensions: [".ts", ".tsx", ".js"]
41
   },
14
   },
44
   },
17
   },
45
 }
18
 }
46
 
19
 
47
-module.exports =  [backendConf, frontendConf]
20
+module.exports =  [frontendConf]

+ 0
- 47
test/webpack.js View File

1
-const path = require('path');
2
-
3
-const frontendConf = {
4
-  mode: 'production',
5
-  target: "web",
6
-  entry: path.resolve(__dirname, 'TestFrontend.ts'),
7
-  output: {
8
-      path: path.resolve(__dirname, '..'),
9
-      filename: "TestFrontend.js",
10
-      libraryTarget: 'commonjs',
11
-  },
12
-  module: {
13
-    rules: [
14
-      { test: /\.ts?$/, loader: "ts-loader" }
15
-    ]
16
-  },
17
-  resolve: {
18
-    extensions: [".ts", ".tsx", ".js"]
19
-  },
20
-  optimization: {
21
-    minimize: true,
22
-  },
23
-}
24
-
25
-const backendConf = {
26
-  mode: 'production',
27
-  target: "node",
28
-  entry: path.resolve(__dirname, 'TestBackend.ts'),
29
-  output: {
30
-      path: path.resolve(__dirname, '..'),
31
-      filename: "TestBackend.js",
32
-      libraryTarget: 'commonjs',
33
-  },
34
-  module: {
35
-    rules: [
36
-      { test: /\.ts?$/, loader: "ts-loader" }
37
-    ]
38
-  },
39
-  resolve: {
40
-    extensions: [".ts", ".tsx", ".js"]
41
-  },
42
-  optimization: {
43
-    minimize: false,
44
-  },
45
-}
46
-
47
-module.exports =  [backendConf, frontendConf]

+ 1
- 1
tsconfig.json View File

9
       "strict": true,
9
       "strict": true,
10
       "experimentalDecorators": true
10
       "experimentalDecorators": true
11
     },
11
     },
12
-    "include": ["src/**/*.ts", "test/**/*.ts"],
12
+    "include": ["src/**/*.ts", "test/**/*.ts", "Index.ts"],
13
     "exclude": ["node_modules"]
13
     "exclude": ["node_modules"]
14
   }
14
   }

Loading…
Cancel
Save