elnardu / react-use-c

Use C in your React!
547 stars 16 forks source link

esbuild is so not cursed you can copy html with it #5

Open alinkedd opened 10 months ago

alinkedd commented 10 months ago

like this:

async function build() {
  await fs.rm("dist", { recursive: true, force: true });

  console.log("Building project");
  await sleep(Math.random() * 5000); // gotta keep up with the trends

  await esbuild.build({
    entryPoints: [{ in: "client.jsx", out: "js"}, "index.html"],
    outdir: "dist",
    loader: { ".html": "copy" },
    minify: true,
    bundle: true,
    sourcemap: true,
    plugins: [useCPlugin],
  });
}
elnardu commented 10 months ago

nice!