From 3d3246e0555045126cffa5cd6f8a0e8663eec0fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20S=C3=B8ndergaard?= Date: Tue, 10 Sep 2024 21:54:23 +0200 Subject: [PATCH] Use esbuild for video streamer client --- client/build.mjs | 10 ++++++++++ client/package.json | 3 ++- yarn.lock | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 client/build.mjs diff --git a/client/build.mjs b/client/build.mjs new file mode 100644 index 0000000..adf1d66 --- /dev/null +++ b/client/build.mjs @@ -0,0 +1,10 @@ +import * as esbuild from 'esbuild'; + +await esbuild.build({ + entryPoints: ['src/index.ts'], + bundle: true, + minify: true, + target: ["chrome58","firefox57","safari18","edge18"], + sourcemap: true, + outfile: './dist/live-video-streamer-client.js' +}); \ No newline at end of file diff --git a/client/package.json b/client/package.json index 3cb02c1..5c9e4b7 100644 --- a/client/package.json +++ b/client/package.json @@ -8,7 +8,7 @@ "types": "dist/live-video-streamer-client.d.ts", "version": "0.0.0", "scripts": { - "bundle": "ts-patch install -s && yarn webpack --bail --mode=production \"$@\"", + "bundle": "node ./build.mjs", "bundle-dev": "ts-patch install -s && yarn webpack --bail --mode=development \"$@\"", "clean": "rm -rf build dist node_modules", "test": "yarn jest --clearCache && ts-patch install && jest --config test/jest.config.js \"$@\"" @@ -36,6 +36,7 @@ "@types/jest": "^27.5.1", "@typescript-eslint/eslint-plugin": "^5.23.0", "@typescript-eslint/parser": "^5.23.0", + "esbuild": "^0.23.1", "eslint": "^8.15.0", "jest": "^28.1.0", "jest-environment-jsdom": "^28.1.0", diff --git a/yarn.lock b/yarn.lock index 2f1241f..b2b91e4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9704,6 +9704,7 @@ __metadata: "@typescript-eslint/eslint-plugin": ^5.23.0 "@typescript-eslint/parser": ^5.23.0 es-abstract: ^1.21.2 + esbuild: ^0.23.1 eslint: ^8.15.0 is-typed-array: ^1.1.10 jest: ^28.1.0