from flask import Flask
from flask_assets import Environment, Bundle
app = Flask(__name__)
assets = Environment(app)
css_bundle = Bundle('styles/main.css', filters='cssmin', output='gen/packed.css')
js_bundle = Bundle('js/main.js', filters='jsmin', output='gen/packed.js')
assets.register('css_all', css_bundle)
assets.register('js_all', js_bundle)
{% assets "css_all" %}
<link rel="stylesheet" type="text/css" href="{{ ASSET_URL }}">
{% endassets %}
{% assets "js_all" %}
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
{% endassets %}