Lib.js
Lib.js = Frontend build tool + lazyload js tool
Feature:
lazyload css and js files (base on LazyLoad.js)
support css, js and images files
support sass, scss, compass and coffeescript files
support local files and remote files
support custom ruby script
support minify css and js files (base on sass and uglifier)
support before and after events
Support Filetype:
.css - stylesheet
.js - javascript
.sass - sass
.scss - scss
.coffee - coffeescript
.rb - ruby
Example
// load jquery
lib.jquery(function(){
// something use jquery to do
});
// load jqueryui and not duplicate load jquery
lib.jqueryui(function(){
// something use jqueryui to do
});
// and you can load like
lib('jquery', function(){
// use jquery to do sth.
});
lib('jquery underscore', function(){
// use jquery and underscore to do sth.
});
Getting Started
1. Install zfben_libjs
gem install zfben_libjs
2. Create new libjs project
libjs new