mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 14:30:02 -04:00
add treeshaking + bugfix
This commit is contained in:
parent
3b27792325
commit
0729a3efa8
5 changed files with 22 additions and 15 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -5,3 +5,4 @@ static/bare-mux.js
|
|||
static/bare-client.js
|
||||
static/curl-client.js
|
||||
static/epoxy-client.js
|
||||
meta.json
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import { build } from "esbuild";
|
||||
import time from "esbuild-plugin-time";
|
||||
// import { writeFileSync } from "fs"
|
||||
|
||||
build({
|
||||
const scramjetBuild = await build({
|
||||
entryPoints: {
|
||||
client: "./src/client/index.ts",
|
||||
bundle: "./src/bundle/index.ts",
|
||||
|
@ -16,4 +17,9 @@ build({
|
|||
time()
|
||||
],
|
||||
logLevel: "info",
|
||||
// metafile: true,
|
||||
treeShaking: true,
|
||||
minify: true
|
||||
});
|
||||
|
||||
// writeFileSync("./meta.json", JSON.stringify(scramjetBuild.metafile));
|
||||
|
|
|
@ -31,7 +31,6 @@ function traverseParsedHtml(node, origin?: URL) {
|
|||
if (hasAttrib(node, "data")) node.attribs.data = encodeUrl(node.attribs.data, origin);
|
||||
if (hasAttrib(node, "action")) node.attribs.action = encodeUrl(node.attribs.action, origin);
|
||||
if (hasAttrib(node, "formaction")) node.attribs.formaction = encodeUrl(node.attribs.formaction, origin);
|
||||
if (hasAttrib(node, "form")) node.attribs.action = encodeUrl(node.attribs.action, origin);
|
||||
|
||||
/* other */
|
||||
if (hasAttrib(node, "srcdoc")) node.attribs.srcdoc = rewriteHtml(node.attribs.srcdoc, origin);
|
||||
|
|
|
@ -85,6 +85,7 @@ function App() {
|
|||
<button on:click=${() => BareMux.SetTransport("CurlMod.LibcurlClient", { wisp: store.wispurl })}>use libcurl.js</button>
|
||||
<button on:click=${() => BareMux.SetTransport("EpxMod.EpoxyClient", { wisp: store.wispurl })}>use epoxy</button>
|
||||
<button on:click=${() => BareMux.SetSingletonTransport(new BareMod.BareClient(store.bareurl))}>use bare server 3 (remote)</button>
|
||||
<button on:click=${() => window.open(this.urlencoded)}>open in fullscreen</button>
|
||||
</div>
|
||||
</div>
|
||||
<input class="bar" bind:value=${use(store.url)} on:input=${(e) => (store.url = e.target.value)} on:keyup=${(e) => e.keyCode == 13 && console.log(this.urlencoded = __scramjet$config.prefix + __scramjet$config.codec.encode(e.target.value))} />
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
"rootDir": "./src",
|
||||
"target": "ES2020",
|
||||
"moduleResolution": "Bundler",
|
||||
"noEmit": true,
|
||||
"noEmit": true
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue