nidus-sync/build.js
Eli Ribble 80f4f51b02
Add bootstrap-icons, make sidebar work with bundle logic
I'm starting to get a sense how to do all of this with these new tools.
I've semi-ported the sidebar at this point.
2026-03-21 19:34:23 +00:00

45 lines
915 B
JavaScript

import esbuild from "esbuild";
import vue from "esbuild-plugin-vue3";
import { sassPlugin } from "esbuild-sass-plugin";
const args = process.argv.slice(2);
const watch = args.includes("--watch");
const minify = args.includes("--minify");
const config = {
entryPoints: ["ts/main.ts"],
bundle: true,
format: "esm",
plugins: [
sassPlugin({
quietDeps: true,
silenceDeprecations: ["import"],
type: "css",
}),
vue(),
],
define: {
__VUE_OPTIONS_API__: "true",
__VUE_PROD_DEVTOOLS__: "false",
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: "false",
},
minify,
loader: {
".css": "css",
".woff": "file",
".woff2": "file",
".ttf": "file",
".eot": "file",
},
outdir: "static/gen",
outbase: "ts",
assetNames: "fonts/[name]",
};
if (watch) {
const ctx = await esbuild.context(config);
await ctx.watch();
console.log("Watching for changes...");
} else {
await esbuild.build(config);
}