Skip to content

Commit

Permalink
feat: purge unused css in tailwind
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-karan committed Mar 4, 2021
1 parent d985ecd commit f83a1d1
Show file tree
Hide file tree
Showing 7 changed files with 1,789 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ vendor/
config.yml
.DS_Store
bin/*
node_modules
2 changes: 2 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ builds:
ldflags:
- -s -w -X "main.buildVersion={{ .Tag }} ({{ .ShortCommit }} {{ .Date }})"
dir: ./cmd/doggo/api/
hooks:
pre: make build-frontend

archives:
- format: tar.gz
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@ VERSION := ${HASH}
build-cli:
go build -o ${CLI_BIN} -ldflags="-X 'main.buildVersion=${VERSION}' -X 'main.buildDate=${BUILD_DATE}'" ./cmd/doggo/cli/

.PHONY: build-frontend
build-frontend:
cd cmd/doggo/api && NODE_ENV=production npx tailwindcss build -o ./assets/tailwind.css

.PHONY: build-api
build-api:
go build -o ${API_BIN} -ldflags="-X 'main.buildVersion=${VERSION}' -X 'main.buildDate=${BUILD_DATE}'" ./cmd/doggo/api/

.PHONY: deps
deps:
npm install -D tailwindcss@latest postcss@latest autoprefixer@latest

.PHONY: build
build: build-api build-cli
Expand All @@ -22,7 +29,7 @@ run-cli: build-cli ## Build and Execute the CLI binary after the build step.
${CLI_BIN}

.PHONY: run-api
run-api: build-api ## Build and Execute the API binary after the build step.
run-api: build-frontend build-api ## Build and Execute the API binary after the build step.
${API_BIN} --config config-api-sample.toml

.PHONY: clean
Expand Down
Loading

0 comments on commit f83a1d1

Please sign in to comment.