clean up and edit readme
This commit is contained in:
22
Makefile
22
Makefile
@@ -14,18 +14,28 @@ $(BUILD_DIR)/%.js: $(SRC_DIR)/%.ts ./node_modules
|
||||
mkdir -p $(dir $@)
|
||||
npx swc $< -o $@
|
||||
|
||||
# bundle all the templates into $(BUILD_DIR)/index.html
|
||||
# bundle all the templates into $(BUILD_DIR)/index.html and minify
|
||||
$(BUILD_DIR)/index.html: export TEMPLATES = $(shell cat $(HTML_SRCS))
|
||||
$(BUILD_DIR)/index.html: $(HTML_SRCS) $(BUILD_DIR) ./index.template.html
|
||||
cat ./index.template.html | envsubst '$$TEMPLATES' | tr -d '\n' | sed -r 's/\s+/ /g' > $@
|
||||
|
||||
./node_modules:
|
||||
npm install
|
||||
|
||||
package-lock.json:
|
||||
npm install --loglevel=http
|
||||
|
||||
./node_modules: package-lock.json
|
||||
npm ci --loglevel=http
|
||||
|
||||
serve: all
|
||||
npx serve -s $(BUILD_DIR)
|
||||
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR) ./node_modules
|
||||
dev:
|
||||
npx nodemon --watch $(SRC_DIR) --ext ts,html --exec "make clean && make serve"
|
||||
|
||||
.PHONY: all clean serve
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR)
|
||||
|
||||
nuke:
|
||||
rm -rf ./node_modules
|
||||
|
||||
.PHONY: all clean nuke serve dev
|
||||
|
||||
Reference in New Issue
Block a user