From 878ec0699a9feb6a87d017a964162356e4872424 Mon Sep 17 00:00:00 2001 From: Fred Emmott Date: Tue, 8 Jan 2019 21:42:26 -0800 Subject: [PATCH] make a JS library for other clients --- webui/src/jslib.ts | 16 ++++++++++++++++ webui/webpack.config.js | 7 +++++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 webui/src/jslib.ts diff --git a/webui/src/jslib.ts b/webui/src/jslib.ts new file mode 100644 index 0000000..2e15e9b --- /dev/null +++ b/webui/src/jslib.ts @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2019-present, Frederick Emmott. + * All rights reserved. + * + * This source code is licensed under the MIT license found in the LICENSE file + * in the root directory of this source tree. + */ + +import RPCClient from './RPCClient'; +import handshake from './handshake'; + +window['StreamingRemote'] = { + RPCClient, + handshake, +}; + diff --git a/webui/webpack.config.js b/webui/webpack.config.js index 468450e..8c38fb5 100644 --- a/webui/webpack.config.js +++ b/webui/webpack.config.js @@ -9,10 +9,13 @@ const path = require('path'); module.exports = { - entry: './src/index.ts', + entry: { + bundle: './src/index.ts', + jslib: './src/jslib.ts', + }, output: { path: path.resolve(__dirname, 'dist'), - filename: 'bundle.js' + filename: '[name].js' }, resolve: { extensions: [".ts", ".tsx", ".js"],