From 9eddaa2bb034df879088fed893edd06da0fee420 Mon Sep 17 00:00:00 2001 From: Ev Haus Date: Mon, 19 Feb 2024 19:36:23 -0800 Subject: [PATCH] chore: update build script to ensure clean start --- CONTRIBUTING.md | 2 +- build.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 63edb0b..140e0d3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,5 +14,5 @@ To test client-side rendering, you can run `cd examples/client && bun install && ## Building -To prepare a new release run `bun dist` which will generate the necessary output files in `/dist`. +To prepare a new release run `bun run build` which will generate the necessary output files in `/dist`. diff --git a/build.ts b/build.ts index 2ac2277..5a6cd58 100644 --- a/build.ts +++ b/build.ts @@ -1,4 +1,9 @@ +import { rm } from 'node:fs/promises'; + async function build() { + // Delete dist folder + await rm('./dist', { force: true, recursive: true }); + // Generate bundle await Bun.build({ entrypoints: ['./src/index.ts'],