-
-
Save ekohl/4908170ed9166f6596054d14782eb0fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
""" | |
Automatic provides generator for webpack bundles | |
""" | |
import json | |
import sys | |
paths = [path.rstrip() for path in sys.stdin.readlines()] | |
for path in paths: | |
if path.endswith('webpack/manifest.json'): | |
with open(path) as fh: | |
manifest = json.load(fh) | |
for name, content in manifest['assetsByChunkName'].items(): | |
if isinstance(content, basestring): | |
print 'foreman-webpack({}) = {}'.format(name, content)) | |
else: | |
for chunk in content: | |
print 'foreman-webpack({}) = {}'.format(name, chunk)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment