mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-19 10:26:17 +00:00
Offline compress and minify CSS
This commit is contained in:
16
Makefile
16
Makefile
@@ -5,12 +5,26 @@ develop: setup-git
|
|||||||
setup-git:
|
setup-git:
|
||||||
cd .git/hooks && ln -sf ../../hooks/* ./
|
cd .git/hooks && ln -sf ../../hooks/* ./
|
||||||
|
|
||||||
dist: uglify collectstatic
|
dist: uglify collectstatic compressstatic
|
||||||
|
|
||||||
uglify:
|
uglify:
|
||||||
|
@echo "--> Uglify JS files to static/scripts/dist"
|
||||||
rm -rf static/scripts/dist 2> /dev/null
|
rm -rf static/scripts/dist 2> /dev/null
|
||||||
r.js -o static/scripts/build.js
|
r.js -o static/scripts/build.js
|
||||||
|
|
||||||
collectstatic:
|
collectstatic:
|
||||||
|
@echo "--> Collect django static files to media/assets"
|
||||||
rm -rf media/assets 2> /dev/null
|
rm -rf media/assets 2> /dev/null
|
||||||
python manage.py collectstatic --noinput
|
python manage.py collectstatic --noinput
|
||||||
|
|
||||||
|
compressstatic:
|
||||||
|
@echo "--> Compress static files(css) to media/CACHE"
|
||||||
|
rm -rf media/CACHE 2> /dev/null
|
||||||
|
python manage.py compress
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@echo '--> Cleaning media/static cache & dist'
|
||||||
|
rm -rf media/CACHE 2> /dev/null
|
||||||
|
rm -rf media/assets 2> /dev/null
|
||||||
|
rm -rf static/scripts/dist 2> /dev/null
|
||||||
|
@echo ""
|
||||||
|
@@ -416,6 +416,10 @@ COMPRESS_URL = MEDIA_URL
|
|||||||
COMPRESS_ROOT = MEDIA_ROOT
|
COMPRESS_ROOT = MEDIA_ROOT
|
||||||
COMPRESS_DEBUG_TOGGLE = 'nocompress'
|
COMPRESS_DEBUG_TOGGLE = 'nocompress'
|
||||||
COMPRESS_CSS_HASHING_METHOD = 'content'
|
COMPRESS_CSS_HASHING_METHOD = 'content'
|
||||||
|
COMPRESS_OFFLINE = True
|
||||||
|
COMPRESS_OFFLINE_CONTEXT = {'MEDIA_URL': MEDIA_URL, 'base_template': 'base.html'}
|
||||||
|
COMPRESS_CSS_FILTERS = ['compressor.filters.cssmin.CSSMinFilter']
|
||||||
|
|
||||||
|
|
||||||
###################
|
###################
|
||||||
# Image Thumbnail #
|
# Image Thumbnail #
|
||||||
|
Reference in New Issue
Block a user