-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_assets.py
36 lines (29 loc) · 917 Bytes
/
build_assets.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import os
from webassets import Bundle
from webassets import Environment
css = Bundle('src/css/app.css',
output='dist/breeze.css')
js = Bundle('src/js/*.js',
output='dist/breeze.js')
jsm = Bundle('src/js/*.js', filters='jsmin',
output='dist/breeze.min.js')
jst = Bundle('src/html/*.html', filters='jst',
output='dist/breeze_jst.js')
assets_env = Environment('.')
try:
os.mkdir('.webassets-cache')
except:
pass
assets_env.cache = '.webassets-cache'
assets_env.register('css', css)
assets_env.register('js', js)
assets_env.register('jsmin', jsm)
assets_env.register('jst', jst)
if __name__ == "__main__":
from webassets.script import CommandLineEnvironment
import logging
log = logging.getLogger('webassets')
log.addHandler(logging.StreamHandler())
log.setLevel(logging.DEBUG)
cmdenv = CommandLineEnvironment(assets_env, log)
cmdenv.build()