mirror of
https://github.com/haiwen/seahub.git
synced 2025-05-13 10:25:46 +00:00
Offline compress and minify CSS
This commit is contained in:
parent
49f497d037
commit
914040a22a
16
Makefile
16
Makefile
@ -5,12 +5,26 @@ develop: setup-git
|
||||
setup-git:
|
||||
cd .git/hooks && ln -sf ../../hooks/* ./
|
||||
|
||||
dist: uglify collectstatic
|
||||
dist: uglify collectstatic compressstatic
|
||||
|
||||
uglify:
|
||||
@echo "--> Uglify JS files to static/scripts/dist"
|
||||
rm -rf static/scripts/dist 2> /dev/null
|
||||
r.js -o static/scripts/build.js
|
||||
|
||||
collectstatic:
|
||||
@echo "--> Collect django static files to media/assets"
|
||||
rm -rf media/assets 2> /dev/null
|
||||
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_DEBUG_TOGGLE = 'nocompress'
|
||||
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 #
|
||||
|
Loading…
Reference in New Issue
Block a user