add presentation base
This commit is contained in:
33
client/make.mk
Normal file
33
client/make.mk
Normal file
@@ -0,0 +1,33 @@
|
||||
CLIENT_PAGES := index.html
|
||||
CLIENT_STYLES := style.css
|
||||
CLIENT_SCRIPTS := script.js
|
||||
CLIENT_TARGETS := $(CLIENT_PAGES:%=static/%) \
|
||||
$(CLIENT_STYLES:%=static/%) \
|
||||
$(CLIENT_SCRIPTS:%=static/%)
|
||||
|
||||
.PHONY: client_clean
|
||||
client_clean:
|
||||
rm -rf static
|
||||
rm -rf client/node_modules
|
||||
|
||||
client/node_modules:
|
||||
cd client && bun install
|
||||
|
||||
static/%.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 > $@
|
||||
|
||||
static/%.css: client/%.scss client/node_modules
|
||||
@mkdir -p $(@D)
|
||||
bun run --cwd client sass $(notdir $<) --style compressed > $@
|
||||
|
||||
static/%.js: client/%.ts client/node_modules
|
||||
@mkdir -p $(@D)
|
||||
bun build $< --minify --outfile $@
|
Reference in New Issue
Block a user