[sudo] npm install -g tiny-asset-pipeline
- Dependency management for Less(or CSS): support mixture @import of .css and .less. CSS file is processed just as less(merge all @import recursively, compile it by lessc). Note that this project includes a modified version of lessc(see modules/less).
require("../subDir/foo.js")to require foo.js.
- Note: both
require(for js) and
@import(for css and less) are using relative path, such as
- default will rewrite asset file name(append md5 hash to name,such as
- all other assets, such as images and fonts, are copied and renamed to destination 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 env , start server(as assets pipeline server, compile .less, concat .css and .js per request ):
tiny-asset-pipeline -start [-port 8888] [-root yourAssetsRoot]
- for production env , 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.