wip: add client base and basic router
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
TARGETS_CLIENT_PAGES := index.html not_found.html
|
||||
TARGETS_CLIENT_SCRIPTS := script.js
|
||||
TARGETS_CLIENT_STYLES := style.css
|
||||
TARGETS_CLIENT := $(TARGETS_CLIENT_PAGES:%=dst/%) \
|
||||
$(TARGETS_CLIENT_SCRIPTS:%=dst/%) \
|
||||
$(TARGETS_CLIENT_STYLES:%=dst/%)
|
||||
|
||||
.PHONY: client_clean
|
||||
client_clean:
|
||||
rm -rf client/node_modules
|
||||
|
||||
client/node_modules:
|
||||
cd client && bun install
|
||||
|
||||
dst/%.html: client/%.html client/node_modules
|
||||
@mkdir -p $(@D)
|
||||
cat $< | bun run --cwd client html-minifier \
|
||||
--collapse-inline-tag-whitespace \
|
||||
--collapse-boolean-attributes \
|
||||
--collapse-whitespace \
|
||||
--remove-attribute-quotes \
|
||||
--remove-comments \
|
||||
--remove-redundant-attributes > $@
|
||||
|
||||
dst/%.css: client/%.scss client/node_modules
|
||||
@mkdir -p $(@D)
|
||||
bun run --cwd client sass $(notdir $<) --style compressed > $@
|
||||
|
||||
dst/%.js: client/%.ts client/node_modules
|
||||
@mkdir -p $(@D)
|
||||
bun build $< --minify --outfile $@
|
||||
|
Reference in New Issue
Block a user