2021-11-17 13:41:22 -05:00
|
|
|
from django.conf import settings
|
2021-11-16 11:27:09 -05:00
|
|
|
from pipeline.finders import FileSystemFinder as PipelineFileSystemFinder
|
2021-11-17 13:41:22 -05:00
|
|
|
from pipeline.storage import GZIPMixin
|
|
|
|
from pipeline.storage import PipelineManifestStorage
|
2021-11-16 11:27:09 -05:00
|
|
|
|
2021-11-17 13:41:22 -05:00
|
|
|
class PipelineStorage(PipelineManifestStorage):
|
|
|
|
def url(self, *args, **kwargs):
|
|
|
|
url = super().url(*args, **kwargs)
|
|
|
|
if settings.DEBUG_ASSETS:
|
|
|
|
url = url.replace(settings.STATIC_URL, settings.MEDIA_URL)
|
|
|
|
print(f"Pipeline storage: {args} {kwargs} {url}")
|
|
|
|
return url
|
|
|
|
|
|
|
|
class GzipPipelineStorage(GZIPMixin, PipelineStorage):
|
|
|
|
pass
|
2021-11-16 11:27:09 -05:00
|
|
|
|
|
|
|
class FileSystemFinder(PipelineFileSystemFinder):
|
|
|
|
"""
|
|
|
|
Like FileSystemFinder, but doesn't return any additional ignored patterns
|
|
|
|
|
|
|
|
This allows us to concentrate/compress our components without dragging
|
|
|
|
the raw versions in too.
|
|
|
|
"""
|
|
|
|
ignore_patterns = [
|
|
|
|
# '*.js',
|
|
|
|
# '*.css',
|
|
|
|
'*.less',
|
|
|
|
'*.scss',
|
|
|
|
'*.styl',
|
|
|
|
'*.sh',
|
|
|
|
'*.html',
|
|
|
|
'*.md',
|
|
|
|
'*.markdown',
|
|
|
|
'*.php',
|
|
|
|
'*.txt',
|
|
|
|
'*.gif',
|
|
|
|
'*.png',
|
|
|
|
'*.jpg',
|
|
|
|
'*.svg',
|
|
|
|
'*.ico',
|
|
|
|
'*.psd',
|
|
|
|
'*.ai',
|
|
|
|
'*.sketch',
|
|
|
|
'*.emf',
|
|
|
|
'*.eps',
|
|
|
|
'*.pdf',
|
|
|
|
'*.xml',
|
|
|
|
'README*',
|
|
|
|
'LICENSE*',
|
|
|
|
'*examples*',
|
|
|
|
'*test*',
|
|
|
|
'*bin*',
|
|
|
|
'*samples*',
|
|
|
|
'*docs*',
|
|
|
|
'*build*',
|
|
|
|
'*demo*',
|
|
|
|
'*admin*',
|
|
|
|
'*android*',
|
|
|
|
'*blog*',
|
|
|
|
# '*bookmarklet*',
|
|
|
|
# '*circular*',
|
|
|
|
# '*embed*',
|
|
|
|
'*extensions*',
|
|
|
|
'*ios*',
|
|
|
|
'*android*',
|
|
|
|
'*flash*',
|
|
|
|
'*fonts*',
|
|
|
|
'*images*',
|
|
|
|
# '*jquery-ui*',
|
|
|
|
'*mobile*',
|
|
|
|
'*safari*',
|
|
|
|
# '*social*',
|
|
|
|
# '*vendor*',
|
|
|
|
'Makefile*',
|
|
|
|
'Gemfile*',
|
|
|
|
'node_modules',
|
|
|
|
]
|