hsync 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,10 @@
1
+ /*!
2
+ * The buffer module from node.js, for the browser.
3
+ *
4
+ * @author Feross Aboukhadijeh <https://feross.org>
5
+ * @license MIT
6
+ */
7
+
8
+ /*! For license information please see mqtt.browser.js.LICENSE.txt */
9
+
10
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
package/hsync-web.js CHANGED
@@ -48,9 +48,13 @@ async function dynamicConnect(dynamicHost, useLocalStorage) {
48
48
 
49
49
  }
50
50
 
51
- module.exports = {
51
+
52
+ const hsync = globalThis.hsync || {
52
53
  createConnection: createHsync,
53
54
  dynamicConnect,
54
55
  net,
55
56
  config,
56
57
  };
58
+ globalThis.hsync = hsync;
59
+
60
+ module.exports = hsync;
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "hsync",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "client for hsync-server",
5
5
  "main": "hsync.js",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1",
8
8
  "dev": "nodemon --inspect index.js",
9
- "start": "node index.js"
9
+ "start": "node index.js",
10
+ "build": "webpack && BUILD_MODE=production webpack"
10
11
  },
11
12
  "repository": {
12
13
  "type": "git",
@@ -39,6 +40,8 @@
39
40
  "rawr": "^0.14.0"
40
41
  },
41
42
  "devDependencies": {
42
- "nodemon": "^2.0.20"
43
+ "nodemon": "^2.0.20",
44
+ "webpack": "^5.75.0",
45
+ "webpack-cli": "^5.0.1"
43
46
  }
44
47
  }
@@ -0,0 +1,16 @@
1
+ const path = require('path');
2
+
3
+ const mode = process.env.BUILD_MODE || 'development';
4
+
5
+ module.exports = {
6
+ entry: "./hsync-web.js",
7
+ output: {
8
+ path: path.resolve(__dirname, 'dist'),
9
+ filename: mode === 'development' ? 'hsync.js' : 'hsync.min.js'
10
+ },
11
+ mode,
12
+ resolve: {
13
+ alias: {
14
+ }
15
+ },
16
+ };