mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 15:03:31 +00:00
iframe and Firefox fixes
This commit is contained in:
parent
4b0703cd5b
commit
faefc63309
11 changed files with 472 additions and 380 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { build, context } from "esbuild";
|
||||
import { copyFileSync, existsSync, mkdirSync, rmSync } from "node:fs";
|
||||
import { copyFileSync, existsSync, mkdirSync, rmSync, watch } from "node:fs";
|
||||
import { dirname, join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
|
|
@ -51,8 +51,9 @@ const copyStatic = () => {
|
|||
"icon-16.png",
|
||||
"icon-48.png",
|
||||
"icon-128.png",
|
||||
join("src", "sandbox.html"),
|
||||
join("src", "sandbox.js"),
|
||||
join("src", "sidepanel.html"),
|
||||
join("src", "sandbox.html")
|
||||
];
|
||||
|
||||
for (const relative of filesToCopy) {
|
||||
|
|
@ -82,6 +83,16 @@ const run = async () => {
|
|||
const ctx = await context(buildOptions);
|
||||
await ctx.watch();
|
||||
copyStatic();
|
||||
|
||||
for (const file of filesToCopy) {
|
||||
watch(file, (eventType) => {
|
||||
if (eventType === 'change') {
|
||||
console.log(`\n${file} changed, copying static files...`);
|
||||
copyStatic();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
process.stdout.write("Watching for changes...\n");
|
||||
} else {
|
||||
await build(buildOptions);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue