forked from toddbirchard/plotlydash-flask-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassets.py
More file actions
24 lines (21 loc) · 633 Bytes
/
assets.py
File metadata and controls
24 lines (21 loc) · 633 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""Compile static assets."""
from flask import current_app as app
from flask_assets import Bundle
def compile_static_assets(assets):
"""
Compile stylesheets if in development mode.
:param assets: Flask-Assets Environment
:type assets: Environment
"""
assets.auto_build = True
assets.debug = False
less_bundle = Bundle(
'less/*.less',
filters='less,cssmin',
output='dist/css/styles.css',
extra={'rel': 'stylesheet/less'}
)
assets.register('less_all', less_bundle)
if app.config['FLASK_ENV'] == 'development':
less_bundle.build()
return assets