示例#1
0
文件: static.py 项目: Rikanishu/rdr
# encoding: utf-8

from rdr.application.static import manager
from static_bundle import (JsBundle,
                           CssBundle,
                           OtherFilesBundle,
                           LessCompilerPrepareHandler)

css1 = CssBundle("css")
css1.add_file("fonts.css")
css1.add_file("bootstrap/bootstrap.css")
css1.add_file("bootstrap-theme/theme.css")
css1.add_file("font-awesome/font-awesome.css")
css1.add_file("nvd3/nv.d3.css")
css1.add_file("upload/btn-upload.less")
css1.add_file("app/style.less")
css1.add_file("app/feeds.less")
css1.add_file("app/stats.less")
css1.add_file("app/manage.less")
css1.add_file("app/dashboard.less")
css1.add_file("app/settings.less")
css1.add_file("app/offline-queue.less")
css1.add_prepare_handler(LessCompilerPrepareHandler(output_dir="compiled"))

js1 = JsBundle("js")
js1.add_file("vendors/jquery-1.10.2/jquery.js")
js1.add_file("vendors/angular/angular.js")
js1.add_file("vendors/bootstrap/bootstrap.js")
js1.add_file("vendors/angular-ui-router/angular-ui-router.js")
js1.add_file("vendors/angular-ui-bootstrap/angular-ui-bootstrap.js")
js1.add_file("vendors/ng-draggable/ngDraggable.js")
示例#2
0
# encoding: utf-8

from application import static_manager
from static_bundle import (JsBundle,
                           CssBundle)

css1 = CssBundle("css")
css1.add_file("example1.less")
css1.add_file("example2.css")

js1 = JsBundle("js")
js1.add_file("vendors/example1.js")
js1.add_file("vendors/example2.js")

js2 = JsBundle("js/include")
# modules depends on app.js
js2.add_file("app.js")
js2.add_directory("modules")

builder = static_manager.create_builder()
builder.create_asset("Styles").add_bundle(css1)
builder.create_asset("Vendors", minify=True).add_bundle(js1)
builder.create_asset("Application", minify=True).add_bundle(js2)