-
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c4cb837
commit 39f8139
Showing
45 changed files
with
2,315 additions
and
1,160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
#!/usr/bin/env -S npx tsx -- | ||
#!/usr/bin/env zx | ||
|
||
import { build } from "esbuild" | ||
import babelPlugin from "esbuild-plugin-babel" | ||
|
||
await build({ | ||
entryPoints: ["./dist/index.browser.cjs"], | ||
entryPoints: ["./dist/esm/index.browser.mjs"], | ||
outfile: "./dist/index.browser-bundle.js", | ||
bundle: true, | ||
format: "iife", | ||
globalName: "RPCWebsocket", | ||
minify: true, | ||
plugins: [babelPlugin()], | ||
resolveExtensions: [".js", ".mjs"], | ||
treeShaking: true, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env zx | ||
|
||
import { readdir, rename } from "node:fs/promises" | ||
import { $, path } from "zx" | ||
|
||
await $`tsc -p tsconfig.cjs.json` | ||
await $`tsc -p tsconfig.esm.json` | ||
|
||
const files = ( | ||
await readdir("./dist", { withFileTypes: true, recursive: true }) | ||
).filter(({ isFile }) => isFile) | ||
await Promise.all( | ||
files.map(async (file) => | ||
{ | ||
const extension = file.path.includes("/cjs") ? ".cjs" : ".mjs" | ||
return await rename( | ||
path.join(file.path, file.name), | ||
path.join(file.path, file.name.replace(".js", extension)) | ||
) | ||
}) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.