Skip to content

Commit 164e7e8

Browse files
committed
Add support for the webpack-bundle-tracker@1.0
1 parent 152414c commit 164e7e8

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

webpack_loader/loader.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,24 @@ def get_assets(self):
3838
return self.load_assets()
3939

4040
def filter_chunks(self, chunks):
41-
for chunk in chunks:
42-
ignore = any(regex.match(chunk['name'])
41+
for chunk_name in chunks:
42+
ignore = any(regex.match(chunk_name)
4343
for regex in self.config['ignores'])
4444
if not ignore:
45-
chunk['url'] = self.get_chunk_url(chunk)
45+
chunk = {
46+
'name': chunk_name,
47+
'url': self.get_chunk_url(chunk_name)
48+
}
4649
yield chunk
4750

48-
def get_chunk_url(self, chunk):
51+
def get_chunk_url(self, chunk_name):
52+
chunk = self.get_assets().get('assets').get(chunk_name)
4953
public_path = chunk.get('publicPath')
5054
if public_path:
5155
return public_path
5256

5357
relpath = '{0}{1}'.format(
54-
self.config['BUNDLE_DIR_NAME'], chunk['name']
58+
self.config['BUNDLE_DIR_NAME'], chunk_name
5559
)
5660
return staticfiles_storage.url(relpath)
5761

0 commit comments

Comments
 (0)