refactor: move dev assets builds output
This commit is contained in:
parent
e2d00b489c
commit
03fa94abdc
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -9,3 +9,6 @@
|
||||||
_fresh/
|
_fresh/
|
||||||
# npm dependencies
|
# npm dependencies
|
||||||
node_modules/
|
node_modules/
|
||||||
|
|
||||||
|
# Dev assets builds
|
||||||
|
static/dev
|
8
build.ts
8
build.ts
|
@ -3,7 +3,7 @@ import { ensureDir } from '$std/fs/mod.ts'
|
||||||
import { parse, resolve } from '$std/path/mod.ts'
|
import { parse, resolve } from '$std/path/mod.ts'
|
||||||
|
|
||||||
console.log('building styles starts')
|
console.log('building styles starts')
|
||||||
await ensureDir('_fresh/static')
|
await ensureDir('_fresh')
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//prevent Deno from exiting before bundle
|
//prevent Deno from exiting before bundle
|
||||||
|
@ -42,12 +42,12 @@ try {
|
||||||
})
|
})
|
||||||
|
|
||||||
await Deno.writeTextFile(
|
await Deno.writeTextFile(
|
||||||
'./static/styles.css',
|
'./static/dev/styles.css',
|
||||||
new TextDecoder().decode(code),
|
new TextDecoder().decode(code),
|
||||||
)
|
)
|
||||||
await Deno.writeTextFile(
|
await Deno.writeTextFile(
|
||||||
'./static/styles.map.css',
|
'./static/dev/styles.map.css',
|
||||||
new TextDecoder().decode(map!),
|
new TextDecoder().decode(map ?? new Uint8Array()),
|
||||||
)
|
)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
|
Loading…
Reference in a new issue