Merge pull request #8 from mempool/bugfix/build-script-standalone-tinyify

FIX: change build script to enable standalone
This commit is contained in:
softsimon 2021-04-10 18:45:36 +04:00 committed by GitHub
commit f7ab448cd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 9 deletions

17
dist/mempool.js vendored
View File

@ -653,16 +653,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
var browserWS = function (options, defaultWs, websocketEndpoint) { var browserWS = function (options, defaultWs, websocketEndpoint) {
var ws = new WebSocket(websocketEndpoint || defaultWs); var ws = new WebSocket(websocketEndpoint || defaultWs);
ws.addEventListener('open', function open() { ws.addEventListener('open', function open() {
ws.send(JSON.stringify({ action: 'init' })); handleMessage(ws, options);
setInterval(function timeout() {
ws.send(JSON.stringify({
action: 'want',
data: options,
}));
}, 500);
}); });
return ws; return ws;
}; };
var handleMessage = function (ws, options) {
ws.send(JSON.stringify({ action: 'init' }));
setInterval(function timeout() {
ws.send(JSON.stringify({
action: 'want',
data: options,
}));
}, 500);
};
exports.default = browserWS; exports.default = browserWS;
},{}],10:[function(require,module,exports){ },{}],10:[function(require,module,exports){

2
dist/mempool.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -25,7 +25,7 @@
"scripts": { "scripts": {
"start": "ts-node src/index.ts", "start": "ts-node src/index.ts",
"dev": "nodemon src/index.ts", "dev": "nodemon src/index.ts",
"build": "tsc | browserify lib/index.js --standalone mempoolJS > dist/mempool.js | browserify -p tinyify lib/index.js -o dist/mempool.min.js ", "build": "tsc | browserify lib/index.js --standalone mempoolJS > dist/mempool.js | browserify -p tinyify lib/index.js --standalone mempoolJS > dist/mempool.min.js",
"prepare": "npm run build", "prepare": "npm run build",
"postversion": "git push && git push --tags" "postversion": "git push && git push --tags"
}, },