This commit is contained in:
Daniel Hübleitner
2019-09-18 07:34:51 +02:00
parent a744e9df9b
commit 7ff0d1e67e
12 changed files with 52 additions and 287 deletions
+10 -2
View File
@@ -5,9 +5,17 @@ import bsock = require('bsock');
import * as T from './Types';
import * as U from './Utils';
import * as I from './Interfaces';
import * as I from './Interfaces';
import * as R from './Responses';
export class Server{
export {
T as Types,
U as Utils,
I as Interfaces,
R as Responses
}
export class Backend{
private ws = http.createServer()
private io = bsock.createServer()
+7 -2
View File
@@ -2,8 +2,13 @@
var bsock = require('bsock')
import * as T from './Types';
import * as I from './Interfaces';
import * as T from './Types';
export {
T as Types,
I as Interfaces,
}
//fix args with defaults like "force = true" -> "force"
@@ -11,7 +16,7 @@ function stripAfterEquals(str:string){
return str.split("=")[0]
}
export class Client implements I.Socket{
export class Frontend implements I.Socket{
private socket: I.Socket
constructor(public port:number, private server: string, private tls: boolean = false){
-66
View File
@@ -1,66 +0,0 @@
const path = require('path');
const TerserPlugin = require('terser-webpack-plugin');
const frontendConf = {
mode: 'production',
target: "web",
entry: path.resolve(__dirname, 'Client.ts'),
output: {
path: path.resolve(__dirname, '../lib'),
filename: 'Frontend.js',
libraryTarget: 'commonjs',
},
module: {
rules: [
{ test: /\.ts?$/, loader: "ts-loader" }
]
},
resolve: {
extensions: [".ts", ".tsx", ".js"]
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
parallel: true,
exclude: [
/\.\/(.*)\/.ts/,
/\.\/(.*).ts/,
],
}),
],
},
}
const backendConf = {
mode: 'production',
target: "node",
entry: path.resolve(__dirname, 'Server.ts'),
output: {
path: path.resolve(__dirname, '../lib'),
filename: 'Backend.js',
libraryTarget: 'commonjs',
},
module: {
rules: [
{ test: /\.ts?$/, loader: "ts-loader" }
]
},
resolve: {
extensions: [".ts", ".tsx", ".js"]
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
parallel: true,
exclude: [
/\.\/(.*)\/.ts/,
/\.\/(.*).ts/,
],
}),
],
},
}
module.exports = [frontendConf, backendConf]