refactor: move dev assets builds output

This commit is contained in:
Julien Oculi 2024-01-15 10:43:48 +01:00
parent e2d00b489c
commit 03fa94abdc
2 changed files with 7 additions and 4 deletions

3
.gitignore vendored
View file

@ -9,3 +9,6 @@
_fresh/
# npm dependencies
node_modules/
# Dev assets builds
static/dev

View file

@ -3,7 +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/static')
await ensureDir('_fresh')
try {
//prevent Deno from exiting before bundle
@ -42,12 +42,12 @@ try {
})
await Deno.writeTextFile(
'./static/styles.css',
'./static/dev/styles.css',
new TextDecoder().decode(code),
)
await Deno.writeTextFile(
'./static/styles.map.css',
new TextDecoder().decode(map!),
'./static/dev/styles.map.css',
new TextDecoder().decode(map ?? new Uint8Array()),
)
} catch (error) {
console.error(error)