Skip to content

Commit 70ae329

Browse files
author
Shezad Khan
committed
Add support for storing stats file in staticstorage
1 parent cf59b2c commit 70ae329

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

webpack_loader/utils.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
'STATS_FILE': 'webpack-stats.json',
1616
# FIXME: Explore usage of fsnotify
1717
'POLL_INTERVAL': 0.1,
18-
'IGNORE': ['.+\.hot-update.js', '.+\.map']
18+
'IGNORE': ['.+\.hot-update.js', '.+\.map'],
19+
'LOCAL': True,
1920
}
2021
}
2122

@@ -44,8 +45,12 @@ def get_config(config_name):
4445

4546

4647
def get_assets(config):
48+
if not config["LOCAL"]:
49+
open_file_func = staticfiles_storage.open
50+
else:
51+
open_file_func = open
4752
try:
48-
with open(config['STATS_FILE']) as f:
53+
with open_file_func(config['STATS_FILE']) as f:
4954
return json.load(f)
5055
except IOError:
5156
raise IOError(

0 commit comments

Comments
 (0)