Skip to content

Commit

Permalink
use esbuild to minimize CSS
Browse files Browse the repository at this point in the history
we already using esbuild to build .js files and it seems to be at least
as effective at minimizing CSS as clean-css that we used before
  • Loading branch information
pirxpilot committed Sep 17, 2024
1 parent a487edf commit 240b7b4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 138 deletions.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,15 @@ all: lint test build
--output $@ $@

%.min.css: %.css
$(NODE_BIN)/cleancss -O1 --output $@ $<
$(NODE_BIN)/esbuild \
--log-level=warning \
--color=false \
--minify \
--external:*.woff2 \
--sourcemap=external \
--sources-content=false \
--bundle $< \
--outfile=$@

node_modules: package.json pnpm-lock.yaml
pnpm install -C $(@D) --silent --frozen-lockfile
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
"devDependencies": {
"@biomejs/biome": "^1.5.1",
"@pirxpilot/replay": "^2.2.1",
"clean-css-cli": "^5.6.3",
"commander": "~12",
"postcss": "~8",
"postcss-cachify": "^4.0.0",
Expand Down
136 changes: 0 additions & 136 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 240b7b4

Please sign in to comment.