feat: add more functionality

This commit is contained in:
2026-09-17 04:35:18 +08:00
parent 3fe95e925e
commit e3d55e4b7e
13 changed files with 189 additions and 184 deletions
+16 -1
View File
@@ -1,5 +1,16 @@
import * as esbuild from "esbuild";
const VERSION = "0.0.7";
const IS_DIST =
process.argv.indexOf("--prod") !== -1 || process.argv.indexOf("-p") !== -1;
const WS_URL = IS_DIST ? process.env.WS_URL : "ws://127.0.0.1:8787";
//////////////////////////////////////////////
console.log("VERSION", VERSION);
console.log("IS_DIST", IS_DIST);
console.log("WS_URL", WS_URL);
await esbuild.build({
entryPoints: ["src/userscript/index.ts"],
outfile: "dist/whatsapp-bridge.user.js",
@@ -9,12 +20,16 @@ await esbuild.build({
platform: "browser",
target: "es2020",
define: {
__WS_URL__: JSON.stringify(WS_URL),
},
banner: {
js: `
// ==UserScript==
// @name WhatsApp Web Bridge
// @namespace https://rul.sh/
// @version 0.0.6
// @version ${VERSION}
// @description WhatsApp Web WebSocket bridge
// @match https://web.whatsapp.com/*
// @updateURL https://git.rul.sh/khairul169/whatsapp-bridge/raw/branch/main/dist/whatsapp-bridge.user.js