Browse Source

adjust webext build scripts

master
coomdev 9 months ago
parent
commit
1cc281e964
  1. 6
      build-chrome.js
  2. 6
      build-ff.js

6
build-chrome.js

@ -45,7 +45,7 @@ const manif3 = {
const lmanif = manif3;
res = await esbuild.build({
entryPoints: ["src/main.js"],
entryPoints: ["src/main.ts"],
bundle: true,
treeShaking: true,
outdir: "./chrome/dist",
@ -59,7 +59,7 @@ const manif3 = {
},
// inject: ["./esbuild.inject.js"],
plugins: [],
loader: { ".bin": "text", ".wasm": "binary" }, // Hacky solution for loading model.weights.bin but it works for now.
loader: { ".bin": "binary", ".wasm": "binary" }, // Hacky solution for loading model.weights.bin but it works for now.
metafile: true,
});
@ -97,7 +97,7 @@ const manif3 = {
writeFileSync("./chrome/manifest.json", JSON.stringify(lmanif, null, 2));
copyFileSync("./logo.png", "./chrome/1449696017588.png");
copyFileSync("./src/model.weights.bin", "./chrome/model.weights.bin");
copyFileSync("./src/group1-shard1of1.bin", "./chrome/group1-shard1of1.bin");
copyFileSync(
"./src/tfjs-backend-wasm-threaded-simd.wasm",
"./chrome/tfjs-backend-wasm-threaded-simd.wasm"

6
build-ff.js

@ -50,7 +50,7 @@ const manif = {
let res;
res = await esbuild.build({
entryPoints: ["src/main.js"],
entryPoints: ["src/main.ts"],
bundle: true,
treeShaking: true,
outdir: "./firefox/dist",
@ -64,7 +64,7 @@ const manif = {
},
// inject: ["./esbuild.inject.js"],
plugins: [],
loader: { ".bin": "text", ".wasm": "binary" },
loader: { ".bin": "binary", ".wasm": "binary" },
metafile: true,
});
@ -102,7 +102,7 @@ const manif = {
writeFileSync("./firefox/manifest.json", JSON.stringify(manif, null, 2));
copyFileSync("./logo.png", "./firefox/1449696017588.png");
copyFileSync("./src/model.weights.bin", "./firefox/model.weights.bin");
copyFileSync("./src/group1-shard1of1.bin", "./firefox/group1-shard1of1.bin");
copyFileSync(
"./src/tfjs-backend-wasm-threaded-simd.wasm",
"./firefox/tfjs-backend-wasm-threaded-simd.wasm"

Loading…
Cancel
Save