2026-03-20 23:46:17 +01:00
|
|
|
const esbuild = require("esbuild");
|
|
|
|
|
const sveltePlugin = require("esbuild-svelte");
|
|
|
|
|
const path = require("path");
|
2026-03-07 09:04:22 +01:00
|
|
|
|
2026-03-20 23:46:17 +01:00
|
|
|
Promise.all([
|
|
|
|
|
// Build shim-loader.js
|
|
|
|
|
esbuild.build({
|
|
|
|
|
entryPoints: [path.join(__dirname, "src", "shims", "loader.js")],
|
|
|
|
|
bundle: true,
|
|
|
|
|
outfile: path.join(__dirname, "dist", "shim-loader.js"),
|
|
|
|
|
format: "iife",
|
|
|
|
|
platform: "browser",
|
|
|
|
|
target: ["chrome90"],
|
|
|
|
|
alias: {
|
|
|
|
|
path: "path-browserify",
|
|
|
|
|
},
|
|
|
|
|
logLevel: "info",
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
|
|
// Build ignis-ui.js
|
|
|
|
|
esbuild.build({
|
|
|
|
|
entryPoints: [path.join(__dirname, "src", "ui", "index.js")],
|
|
|
|
|
bundle: true,
|
|
|
|
|
outfile: path.join(__dirname, "dist", "ignis-ui.js"),
|
|
|
|
|
format: "iife",
|
|
|
|
|
globalName: "IgnisUI",
|
|
|
|
|
platform: "browser",
|
|
|
|
|
target: ["chrome90"],
|
|
|
|
|
mainFields: ["svelte", "browser", "module", "main"],
|
|
|
|
|
conditions: ["svelte", "browser"],
|
|
|
|
|
plugins: [sveltePlugin({ compilerOptions: { css: "injected" } })],
|
|
|
|
|
logLevel: "info",
|
|
|
|
|
}),
|
2026-03-27 19:53:19 +01:00
|
|
|
|
|
|
|
|
// Build ignis-bridge plugin
|
|
|
|
|
esbuild.build({
|
|
|
|
|
entryPoints: [path.join(__dirname, "plugin", "src", "main.js")],
|
|
|
|
|
bundle: true,
|
|
|
|
|
outfile: path.join(__dirname, "plugin", "main.js"),
|
|
|
|
|
format: "cjs",
|
|
|
|
|
platform: "browser",
|
|
|
|
|
target: ["chrome90"],
|
2026-03-29 00:26:41 +01:00
|
|
|
external: ["obsidian", "fs"],
|
|
|
|
|
logLevel: "info",
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
|
|
// Build headless-sync bundled plugin
|
|
|
|
|
esbuild.build({
|
|
|
|
|
entryPoints: [
|
|
|
|
|
path.join(
|
|
|
|
|
__dirname,
|
|
|
|
|
"server",
|
|
|
|
|
"plugins",
|
|
|
|
|
"headless-sync",
|
|
|
|
|
"plugin",
|
|
|
|
|
"src",
|
|
|
|
|
"main.js",
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
bundle: true,
|
|
|
|
|
outfile: path.join(
|
|
|
|
|
__dirname,
|
|
|
|
|
"server",
|
|
|
|
|
"plugins",
|
|
|
|
|
"headless-sync",
|
|
|
|
|
"plugin",
|
|
|
|
|
"main.js",
|
|
|
|
|
),
|
|
|
|
|
format: "cjs",
|
|
|
|
|
platform: "browser",
|
|
|
|
|
target: ["chrome90"],
|
2026-03-27 19:53:19 +01:00
|
|
|
external: ["obsidian"],
|
|
|
|
|
logLevel: "info",
|
|
|
|
|
}),
|
2026-03-20 23:46:17 +01:00
|
|
|
]).catch(() => process.exit(1));
|