From d912ea247d2f42cf323cf63274ef73bbfde0501c Mon Sep 17 00:00:00 2001 From: Julien Oculi Date: Sun, 14 Jan 2024 20:54:49 +0100 Subject: [PATCH] refactor: use _fresh as build cache directory --- .gitignore | 2 -- build.ts | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 39ca461..5b4bdef 100644 --- a/.gitignore +++ b/.gitignore @@ -9,5 +9,3 @@ _fresh/ # npm dependencies node_modules/ - -.cache/ \ No newline at end of file diff --git a/build.ts b/build.ts index e5b7c4c..74a9c2b 100644 --- a/build.ts +++ b/build.ts @@ -3,6 +3,7 @@ import { ensureDir } from '$std/fs/mod.ts' import { parse, resolve } from '$std/path/mod.ts' console.log('building styles starts') +await ensureDir('_fresh') try { //prevent Deno from exiting before bundle @@ -30,8 +31,7 @@ try { const response = await fetch(specifier) const file = await response.text() - await ensureDir('.cache') - const filename = `.cache/${crypto.randomUUID()}.css` + const filename = `_fresh/${crypto.randomUUID()}` await Deno.writeTextFile(filename, file) cssImports.set(specifier, filename) return filename @@ -40,11 +40,11 @@ try { }) await Deno.writeTextFile( - './static/styles.css', + './_fresh/styles.css', new TextDecoder().decode(code), ) await Deno.writeTextFile( - './static/styles.map.css', + './_fresh/styles.map.css', new TextDecoder().decode(map!), ) } catch (error) {