File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -8,15 +8,14 @@ def create_app():
88 app = Flask (__name__ , instance_relative_config = False )
99 app .config .from_object ("config.Config" )
1010 assets = Environment ()
11- assets .init_app (app )
1211
1312 # Initialize plugins
1413 assets .init_app (app )
1514
1615 with app .app_context ():
1716 # Import parts of our flask_assets_tutorial
1817 from .admin import routes as admin_routes
19- from .assets import compile_static_assets , compile_stylesheet_bundles
18+ from .assets import compile_js_assets , compile_stylesheet_bundles
2019 from .main import routes as main_routes
2120
2221 # Register Blueprints
@@ -25,6 +24,6 @@ def create_app():
2524
2625 # Compile static assets
2726 compile_stylesheet_bundles (assets )
28- compile_static_assets (assets )
27+ compile_js_assets (assets )
2928
3029 return app
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ def compile_stylesheet_bundles(assets: Environment) -> Environment:
3535 return assets
3636
3737
38- def compile_static_assets (assets : Environment ) -> Environment :
38+ def compile_js_assets (assets : Environment ) -> Environment :
3939 """
4040 Create minified JS bundles from raw Javascript files.
4141
@@ -45,6 +45,6 @@ def compile_static_assets(assets: Environment) -> Environment:
4545 """
4646 main_js_bundle = Bundle ("src/js/main.js" , filters = "jsmin" , output = "dist/js/main.min.js" ) # Main JavaScript Bundle
4747 assets .register ("main_js" , main_js_bundle )
48- if app .config ["ENVIRONMENT" ] != "production " :
48+ if app .config ["ENVIRONMENT" ] == "development " :
4949 main_js_bundle .build ()
5050 return assets
You can’t perform that action at this time.
0 commit comments