简体   繁体   English

使用require js优化器进行CSS缩小

[英]CSS minification using require js optimizer

We have web application based on Backbone and Require JS. 我们有基于Backbone和Require JS的Web应用程序。 Currrently we uses Require Js optimizer to optimize the code. 当前,我们使用Require Js优化器来优化代码。

It works well for js files. 它适用于js文件。 I could see some css minification steps in Require JS documentation, but it does not work 我可以在Require JS文档中看到一些CSS缩小步骤,但是它不起作用

Is there any way to do it? 有什么办法吗? Consider i have 10 css files. 考虑我有10个CSS文件。

I use grunt's build tool and then there are a bunch of tasks you can load including grunt-contrib which has both the tasks you need requirejs and mincss . 我使用grunt的构建工具 ,然后您可以加载许多任务,包括grunt-contrib ,其中既包含您需要的任务requirejsmincss Use this to load grunt-contrib within your grunt file. 使用它在grunt文件中加载grunt-contrib。

grunt.loadNpmTasks('grunt-contrib');  

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM