Django Pipeline正在生成空的css和js文件

时间:2014-12-07 10:48:49

标签: django

我正面临一个问题Django Pipeline生成的空文件没有写出文件的内容..

是我的设置

PIPELINE_CSS = {
  'main2': {
    'source_filenames': (
        'vendor/introJs/introjs.css',
        'vendor/introjs-theme-royal.css',


    ),
    'output_filename': 'css/main2.min.css',
     'variant': 'datauri',
  },
}

PIPELINE_JS = {
  'main': {
    'source_filenames': (
        'js/libs/jquery.js',
        'js/libs/lodash.js',
        'js/libs/json2.js',
        'js/libs/*.js',
        #'vendor/jqueryui/js/*.js',
        'js/plugins/*.js',
        'js/tools.js',
        'js/models.js',
        'js/modules/*.js',
        'js/main.js',

    ),
    'output_filename': 'js/main.min.js',
  },
}

1 个答案:

答案 0 :(得分:0)

检查PIPELINE_CSS_COMPRESSORPIPELINE_JS_COMPRESSOR可能您的压缩器工作不正常,请尝试使用这些值进行测试:

PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.NoopCompressor' 
PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.NoopCompressor'
STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage'
STATICFILES_FINDERS = (
   'django.contrib.staticfiles.finders.FileSystemFinder',
   'django.contrib.staticfiles.finders.AppDirectoriesFinder',
   'pipeline.finders.PipelineFinder',
)

管道默认使用Yuglify(参见https://django-pipeline.readthedocs.org/en/latest/compressors.html