Switch to using single-file components (SFC) in Vue

This commit is contained in:
Eli Ribble 2026-03-21 17:51:25 +00:00
parent ccdb391ccc
commit 0126d24242
No known key found for this signature in database
6 changed files with 362 additions and 21 deletions

28
build.js Normal file
View file

@ -0,0 +1,28 @@
import esbuild from "esbuild";
import vue from "esbuild-plugin-vue3";
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",
outfile: "static/gen/js/bundle.js",
plugins: [vue()],
define: {
__VUE_OPTIONS_API__: "true",
__VUE_PROD_DEVTOOLS__: "false",
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: "false",
},
minify,
};
if (watch) {
const ctx = await esbuild.context(config);
await ctx.watch();
console.log("Watching for changes...");
} else {
await esbuild.build(config);
}