Create build system (#1)
This commit is contained in:
33
client/client.mk
Normal file
33
client/client.mk
Normal file
@@ -0,0 +1,33 @@
|
||||
client/node_modules:
|
||||
bun install --cwd client
|
||||
|
||||
client/dst:
|
||||
mkdir client/dst
|
||||
|
||||
client/dst/%.html: \
|
||||
client/src/%.html \
|
||||
client/node_modules \
|
||||
client/dst \
|
||||
$(SEARCH_REPLACE)
|
||||
cat $< | bun run --cwd client html-minifier \
|
||||
--collapse-inline-tag-whitespace \
|
||||
--collapse-boolean-attributes \
|
||||
--collapse-whitespace \
|
||||
--remove-attribute-quotes \
|
||||
--remove-comments \
|
||||
--remove-redundant-attributes | \
|
||||
$(SEARCH_REPLACE) \
|
||||
'##LT##' '<' \
|
||||
'##GT##' '>' \
|
||||
> $@
|
||||
|
||||
client/dst/%.js: client/src/%.ts client/node_modules client/dst
|
||||
bun build $< --minify --outfile $@
|
||||
|
||||
client/dst/%.css: client/src/%.scss client/node_modules client/dst
|
||||
cat $< | bun run --cwd client sass --stdin --style compressed > $@
|
||||
|
||||
.PHONY: client_clean
|
||||
client_clean:
|
||||
rm -rf client/dst
|
||||
rm -rf client/node_modules
|
Reference in New Issue
Block a user