Browse Source

Launcher

master
peter 2 years ago
parent
commit
3584e8e5c8
4 changed files with 39 additions and 4 deletions
  1. 1
    1
      src/backend/Admin.ts
  2. 1
    3
      src/backend/Installer.ts
  3. 2
    0
      src/backend/Launcher.ts
  4. 35
    0
      src/backend/webpack.prod.js

+ 1
- 1
src/backend/Admin.ts View File

@@ -79,7 +79,7 @@ export class FrontblockAdmin extends AdminBase<AdminConf>{
79 79
     }
80 80
 
81 81
     private destroy(){
82
-        this.startWebsocket()
82
+        this.wsServer.close()
83 83
         this.stopWebserver()
84 84
     }
85 85
 

+ 1
- 3
src/backend/Installer.ts View File

@@ -29,6 +29,4 @@ export const install = (plugins: Plugin[] = [], npmPkgs: [NPMPkgName, NPMVersion
29 29
         new Admin(plugins)
30 30
     })
31 31
 
32
-}
33
-
34
-install([], [['sqlite3', '4.1.0'], ['knex', '0.19.2']])
32
+}

+ 2
- 0
src/backend/Launcher.ts View File

@@ -0,0 +1,2 @@
1
+import { install } from "./Installer";
2
+install([], [['sqlite3', '4.1.0'], ['knex', '0.19.2']])

+ 35
- 0
src/backend/webpack.prod.js View File

@@ -39,6 +39,41 @@ module.exports = [{
39 39
     minimize: false
40 40
   },
41 41
   entry: path.resolve(__dirname, 'Installer.ts'),
42
+  output: {
43
+      path: path.resolve(__dirname, '../../dist'),
44
+      filename: 'Installer.js',
45
+      libraryTarget: 'commonjs',
46
+  }
47
+},{
48
+  mode: 'production',
49
+  target: "node",
50
+  node: {
51
+    global: true,
52
+    process: true,
53
+    __filename: false,
54
+    __dirname: false,
55
+    Buffer: true,
56
+  },
57
+
58
+  
59
+  resolve: {
60
+    // Add `.ts` and `.tsx` as a resolvable extension.
61
+
62
+    extensions: [".ts", ".tsx", ".js"]
63
+  },
64
+  module: {
65
+    rules: [
66
+      { test: /\.ts?$/, loader: "ts-loader" }
67
+    ]
68
+  },
69
+
70
+  externals:{
71
+    knex: "../plugins/node_modules/knex"
72
+  },
73
+  optimization: {
74
+    minimize: false
75
+  },
76
+  entry: path.resolve(__dirname, 'Launcher.ts'),
42 77
   output: {
43 78
       path: path.resolve(__dirname, '../../dist'),
44 79
       filename: 'FrontblockAdmin.js',

Loading…
Cancel
Save