Minify CSS

This commit is contained in:
Frederic Guillot 2017-01-02 19:44:13 -05:00
parent bc503d49cd
commit 9234657b17
5 changed files with 11 additions and 1 deletions

View File

@ -19,6 +19,7 @@ Version 1.2.0 (unreleased)
* Add functional tests (Json-RPC API and Fever API) * Add functional tests (Json-RPC API and Fever API)
* Add unit tests * Add unit tests
* Minify Javascript and add automated syntax check on the CI * Minify Javascript and add automated syntax check on the CI
* Minify CSS
Migration procedure from 1.1.x to 1.2.0: Migration procedure from 1.1.x to 1.2.0:

View File

@ -9,6 +9,7 @@
.PHONY: sync-locales .PHONY: sync-locales
.PHONY: find-locales .PHONY: find-locales
CSS_FILE = assets/css/app.min.css
JS_FILE = assets/js/app.min.js JS_FILE = assets/js/app.min.js
CONTAINER = miniflux CONTAINER = miniflux
IMAGE = miniflux/miniflux IMAGE = miniflux/miniflux
@ -26,6 +27,12 @@ docker-destroy:
docker-run: docker-run:
@ docker run --rm --name $(CONTAINER) -P $(IMAGE):$(TAG) @ 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: $(JS_FILE)
$(JS_FILE): assets/js/src/app.js \ $(JS_FILE): assets/js/src/app.js \

View File

@ -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) function format_bytes($size, $precision = 2)

1
assets/css/app.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,6 @@
{ {
"dependencies": { "dependencies": {
"clean-css": "^3.4.23",
"jshint": "^2.9.4", "jshint": "^2.9.4",
"uglify-js": "^2.7.5" "uglify-js": "^2.7.5"
} }