Skip to content

Commit

Permalink
fixed bug when chunk names end with '?<hash>' after .js or .css
Browse files Browse the repository at this point in the history
  • Loading branch information
wizpig64 committed Sep 9, 2023
1 parent f81d9b9 commit f2764ff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions webpack_loader/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ def get_as_tags(bundle_name, extension=None, config='DEFAULT', suffix='', attrs=
tags = []

for chunk in bundle:
if chunk['name'].endswith(('.js', '.js.gz')):
chunk_name = chunk['name'].split('?')[0]
if chunk_name.endswith(('.js', '.js.gz')):
if is_preload:
tags.append((
'<link rel="preload" as="script" href="{0}" {1}/>'
Expand All @@ -85,7 +86,7 @@ def get_as_tags(bundle_name, extension=None, config='DEFAULT', suffix='', attrs=
attrs,
loader.get_integrity_attr(chunk),
))
elif chunk['name'].endswith(('.css', '.css.gz')):
elif chunk_name.endswith(('.css', '.css.gz')):
tags.append((
'<link href="{0}" rel={2}{3}{1}/>'
).format(
Expand Down

0 comments on commit f2764ff

Please sign in to comment.