Commit 2afec1ce by Timothée Peignier

allow to select group used in cache manifest

parent 2e6ad39f
...@@ -79,6 +79,16 @@ Group options ...@@ -79,6 +79,16 @@ Group options
Defaults to ``None``. Defaults to ``None``.
``manifest``
............
**Optional**
Indicate if you want this group to appear in your cache manifest.
Defaults to ``True``.
``extra_context`` ``extra_context``
................. .................
......
...@@ -15,9 +15,13 @@ class PipelineManifest(Manifest): ...@@ -15,9 +15,13 @@ class PipelineManifest(Manifest):
def collect_packages(self): def collect_packages(self):
packages = [] packages = []
for package_name in self.packager.packages['css']: for package_name in self.packager.packages['css']:
packages.append(self.packager.package_for('css', package_name)) package = self.packager.package_for('css', package_name)
if package['manifest']:
packages.append(package)
for package_name in self.packager.packages['js']: for package_name in self.packager.packages['js']:
packages.append(self.packager.package_for('js', package_name)) package = self.packager.package_for('js', package_name)
if package['manifest']:
packages.append(package)
return packages return packages
def cache(self): def cache(self):
......
...@@ -95,12 +95,15 @@ class Packager(object): ...@@ -95,12 +95,15 @@ class Packager(object):
packages[name]['templates'] = [path for path in paths if path.endswith(settings.PIPELINE_TEMPLATE_EXT)] packages[name]['templates'] = [path for path in paths if path.endswith(settings.PIPELINE_TEMPLATE_EXT)]
packages[name]['output'] = config[name]['output_filename'] packages[name]['output'] = config[name]['output_filename']
packages[name]['context'] = {} packages[name]['context'] = {}
packages[name]['manifest'] = True
if 'extra_context' in config[name]: if 'extra_context' in config[name]:
packages[name]['context'] = config[name]['extra_context'] packages[name]['context'] = config[name]['extra_context']
if 'template_name' in config[name]: if 'template_name' in config[name]:
packages[name]['template'] = config[name]['template_name'] packages[name]['template'] = config[name]['template_name']
if 'variant' in config[name]: if 'variant' in config[name]:
packages[name]['variant'] = config[name]['variant'] packages[name]['variant'] = config[name]['variant']
if 'manifest' in config[name]:
packages[name]['manifest'] = config[name]['manifest']
return packages return packages
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment