npm install -g tiny-asset-pipeline
- Dependency management for Less(or CSS): support mixture @import of .css and .less. All *.css file is processed same as Less file(merge all @import recursively, compile it by lessc). It use the latest(v2.3.1) Less.js.
require("../subDir/foo.js")to require foo.js.
- It integrated with autoprefixer. So you can write your CSS rules without vendor prefixes (in fact, forget about them entirely).
- Note: both
require(for js) and
@import(for css and less) are using relative path, such as
@import ../plugin/foo.css. Images and fonts also use relative path.
- It will rename asset(append md5 hash to name,such as
- All other assets except js/css/less, such as images and fonts, are copied and renamed to deploy directoty. All reference urls of images and fonts in the .less/.css are renamed automatically(such as
- A md5_mapping.json will be generated under the root of destination directoty, you can set the
-mappingFileoption to config the file path and name.
- All *.js , *.less * and *.css will be processed.
- For partials files: any file(or directory) start with
.will be ignorged(does not been processed), such as
- For development environment , start server(as assets pipeline server, compile .less, concat .css and .js per request ):
tiny-asset-pipeline -start [-port 8888] [-root yourAssetsRoot]
- For production environment , batch process before deploy assets to production env :
tiny-asset-pipeline -from sourceDir -to destinationDir [-verbose or -v]. Finally it will generate a md5_mapping.json under the root of destination directoty, you can read the content to find the md5 hash of a special file.
Why not Grunt or Gulp?
- Because I hate to write many configuration.