Giter VIP home page Giter VIP logo

css-combo's Introduction

css-combo

Build Status

Introduction

combo css which import other css 对于js,目前已经有比较成熟的模块化方案,比如seajs、kissy,但是css方面呢,一般是通过less进行编译打包的。less官方对于less文件中的@import "xxx.css"是不会打包进来的,这也是考虑到本身就是有需求要这样引用css,而如果你@import "xxx.less",less打包工具就会分析这些引入的模块,进行打包。 css-combo就是借鉴了这种**,实现了css模块化。即在入口文件中@import其他模块,然后对入口文件进行打包的时候,该工具会分析import的文件,把这些文件打包进来。

对于CSS模块化,欢迎大家看我这篇博文:(http://www.techcheng.com/study/css/introduce-css-combo.html)

Usage

API:

CssCombo.build(cfg, function(err){ callback(); });
  • cfg:{Object} 参数

    • target:{String} 入口文件
    • inputEncoding:{String} 输入文件编码,可选,默认检测入口文件中的@charset设置。如果入口文件没有设置@charset,那么最好设置本选项
    • outputEncoding:{String} 输出文件编码,可选,默认UTF-8
    • output:{String} 输出目录或者输出的完整路径(含文件名,推荐),可以使用相对路径
    • exclude:{Array} 黑名单正则数组,可选,默认空
    • compress: {Boolean} 是否压缩,默认为true,处理规则同YUICompressor
    • debug: {Boolean} 是否打印日志

TODO

* 增加目录打包形式
* <del>增加对模块@charset的检测</del>
* <del>编码转换,最后压缩成ascii</del>

ChangeList

* 0.2.2:修正打包之后输出文件编码问题

License

css-combo 遵守 "MIT":https://github.com/daxingplay/css-combo/blob/master/LICENSE.md 协议

css-combo's People

Contributors

daxingplay avatar jfhbrook avatar maxbbn avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.