Skip to content

Commit

Permalink
Minify CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
fguillot committed Jan 3, 2017
1 parent bc503d4 commit 9234657
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Version 1.2.0 (unreleased)
* Add functional tests (Json-RPC API and Fever API)
* Add unit tests
* Minify Javascript and add automated syntax check on the CI
* Minify CSS

Migration procedure from 1.1.x to 1.2.0:

Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
.PHONY: sync-locales
.PHONY: find-locales

CSS_FILE = assets/css/app.min.css
JS_FILE = assets/js/app.min.js
CONTAINER = miniflux
IMAGE = miniflux/miniflux
Expand All @@ -26,6 +27,12 @@ docker-destroy:
docker-run:
@ docker run --rm --name $(CONTAINER) -P $(IMAGE):$(TAG)

css: $(CSS_FILE)

$(CSS_FILE): assets/css/app.css
@ yarn install || npm install
@ cat $^ | ./node_modules/.bin/cleancss -o $@

js: $(JS_FILE)

$(JS_FILE): assets/js/src/app.js \
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function css()
}
}

return 'assets/css/app.css?version='.filemtime('assets/css/app.css');
return 'assets/css/app.min.css?version='.filemtime('assets/css/app.min.css');
}

function format_bytes($size, $precision = 2)
Expand Down
1 change: 1 addition & 0 deletions assets/css/app.min.css

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"dependencies": {
"clean-css": "^3.4.23",
"jshint": "^2.9.4",
"uglify-js": "^2.7.5"
}
Expand Down

0 comments on commit 9234657

Please sign in to comment.