From f2764ff896ae32305dda3fb786a4e946f0ee452f Mon Sep 17 00:00:00 2001 From: Phillip Marshall Date: Tue, 11 Sep 2018 18:30:15 -0700 Subject: [PATCH] fixed bug when chunk names end with '?' after .js or .css --- webpack_loader/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/webpack_loader/utils.py b/webpack_loader/utils.py index ca844fac..005c1e97 100644 --- a/webpack_loader/utils.py +++ b/webpack_loader/utils.py @@ -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(( '' @@ -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(( '' ).format(