Django-pipeline producing empty files

Issue

Right now, when running python manage.py collectstatic produces a minified file but it is completely empty.

Here are my settings.py (I am on a windows environment):

STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage'
PIPELINE_ENABLED = True
PIPELINE_DISABLE_WRAPPER = True
PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.yui.YUICompressor'
PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.yui.YUICompressor'
PIPELINE_YUI_BINARY = "C:\\path\\to\\the\\yuicompressor.jar"
PIPELINE_JS = {
    'chat': {
        'source_filenames': (
          'js/apps/chat/controllers/chatcontrollers.js',
        ),
        'output_filename': 'js/test.min.js',
    }
}
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR,"static/")
STATICFILES_DIRS = (
    # Put strings here, like "/home/html/static" or "C:/www/django/static".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    os.path.join(
        BASE_DIR,
        'media_src',
    ),
)

I saw this response: Django pipeline generates empty files already but my files are located in

myapp/media_src/js/apps/chat/controllers/

Solution

This led me to the answer:
http://www.daveoncode.com/2013/09/19/configuring-django-pipeline-by-using-closure-compiler-for-javascript-files-and-yui-compressor-for-css/

Looks like the binary needs to be the exact command used to run the binary. In this case it should have been:

PIPELINE_YUI_BINARY = "java -jar C:\\path\\to\\the\\yuicompressor.jar"

Answered By – FinDev

Answer Checked By – Gilberto Lyons (AngularFixing Admin)

Leave a Reply

Your email address will not be published.