Beispiel #1
0
def check():
    conf = BuilderConfig(input_dir="src", output_dir="public", env="development", copy_only_bundles=True)
    development_builder = create_builder(conf)
    development_builder.collect_links()

    print("=" * 60)
    print(" Development static data ")
    print("=" * 60)
    print(development_builder.render_asset("Styles"))
    print("Vendors:")
    print(development_builder.render_asset("Vendors"))
    print("Application:")
    print(development_builder.render_asset("Application"))

    conf.env = "production"
    production_builder = create_builder(conf)
    production_builder.make_build()
    production_builder.collect_links()

    print("=" * 60)
    print(" Production static data [with bundle generation] ")
    print("=" * 60)
    print("Styles:")
    print(production_builder.render_asset("Styles"))
    print("Vendors:")
    print(production_builder.render_asset("Vendors"))
    print("Application:")
    print(production_builder.render_asset("Application"))
Beispiel #2
0
 def rewrite_static(filename):
     cache_timeout = app.get_send_file_max_age(filename)
     return send_from_directory(BuilderConfig.init_path(static_path), filename,
                                cache_timeout=cache_timeout)