File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,10 @@ def render_bundle(bundle_name):
1212 bundle = get_bundle (bundle_name )
1313 tags = []
1414 for chunk in bundle :
15+
1516 if chunk ['name' ].endswith ('.js' ):
16- tags .append ('<script type="text/javascript" src="{}"/>' .format (chunk ['publicPath' ]))
17+ url = chunk .get ('publicPath' ) or chunk ['url' ]
18+ tags .append ('<script type="text/javascript" src="{}"/>' .format (url ))
1719 elif chunk ['name' ].endwith ('.css' ):
18- tags .append ('<link type="text/css" href="{}" rel="stylesheet"/>' .format (chunk [ 'publicPath' ] ))
20+ tags .append ('<link type="text/css" href="{}" rel="stylesheet"/>' .format (url ))
1921 return '\n ' .join (tags )
Original file line number Diff line number Diff line change 33
44from django .conf import settings
55
6- static_path = getattr (settings , 'WEBPACK_BUNDLE_PATH ' , 'webpack_bundles/' )
7- stats_file = getattr (settings , 'WEBPACK_STATS_FILE ' , 'webpack-stats.json' )
6+ bundle_url = getattr (settings , 'WEBPACK_BUNDLE_URL ' , 'webpack_bundles/' )
7+ stats_file = getattr (settings , 'WEBPACK_STATS_FILE_PATH ' , 'webpack-stats.json' )
88
99
1010__all__ = ('get_bundle' ,)
@@ -32,8 +32,7 @@ def get_bundle(bundle_name):
3232 if assets .get ('status' ) == 'done' :
3333 bundle = assets ['chunks' ][bundle_name ]
3434 for F in bundle :
35- F ['url' ] = '{}{}' .format (static_path , F ['name' ])
36- print bundle
35+ F ['url' ] = '{}{}' .format (bundle_url , F ['name' ])
3736 return bundle
3837
3938 elif assets .get ('status' ) == 'error' :
You can’t perform that action at this time.
0 commit comments