热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

是否有替代Django的Rails资产管道?-IsthereanalternativetotheRailsassetspipelineforDjango?

UsingtheRailsassetspipelineandapluginforrequire.js,IcanuseCoffeeScript,SASS,filesorg

Using the Rails assets pipeline and a plugin for require.js, I can use CoffeeScript, SASS, files organized however I like and get it all compiled to a single Javascript and single CSS file for production. Is there a matching setup for use with Django? It needs to support the above, CofeeeScript, SASS, Require.JS with a development mode where files are served individually as well as a production mode where everything gets compiled into single files.

使用Rails资产管道和require.js的插件,我可以使用CoffeeScript,SASS,我喜欢组织的文件,并将其全部编译为单个Javascript和单个CSS文件进行生产。是否有与Django一起使用的匹配设置?它需要支持上面的CofeeeScript,SASS,Require.JS以及单独提供文件的开发模式以及将所有内容编译成单个文件的生产模式。

1 个解决方案

#1


7  

I’m using Django Compressor and I’m pretty happy with it. It supports pre-processors so Coffeescript, Sass and so on are supported. Check out the documentation.

我正在使用Django Compressor,我很高兴。它支持预处理器,因此支持Coffeescript,Sass等。查看文档。

EDIT: Here is my settings for SASS and Coffeescript, in settings.py:

编辑:这是我在settings.py中对SASS和Coffeescript的设置:

STATICFILES_FINDERS = (
  'django.contrib.staticfiles.finders.FileSystemFinder',
  'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  'compressor.finders.CompressorFinder',
)

COMPRESS_PRECOMPILERS = (
  ('text/coffeescript', 'coffee --compile --stdio'),
  ('text/x-sass', 'sass {infile} {outfile}'),
  ('text/x-scss', 'sass --scss {infile} {outfile}'),
)

推荐阅读
author-avatar
fengfeng
这个家伙很懒,什么也没留下!
Tags | 热门标签
RankList | 热门文章
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有