move wasm.js into separate file

This commit is contained in:
velzie 2024-08-02 17:30:29 -04:00
parent 929dfcca24
commit cb395552c8
No known key found for this signature in database
GPG key ID: 048413F95F0DDE1F
9 changed files with 33 additions and 7 deletions

View file

@ -8,7 +8,7 @@ import { rewriteJs } from "./js";
export function isScramjetFile(src: string) {
let bool = false;
["codecs", "client", "shared", "worker"].forEach((file) => {
["wasm", "codecs", "client", "shared", "worker"].forEach((file) => {
if (src === self.$scramjet.config[file]) bool = true;
});
@ -122,6 +122,12 @@ function traverseParsedHtml(node, origin?: URL) {
if (node.name === "head") {
const scripts = [];
scripts.push(
new Element("script", {
src: self.$scramjet.config["wasm"],
"data-scramjet": "true",
})
);
const codecs = new Element("script", {
src: self.$scramjet.config["codecs"],
"data-scramjet": "true",