gulp-resource-cache
Concatenating and wrapping resources to cache
npm
Install withnpm install gulp-resource-cache
Usage
gulp ;
You get merged file:
{ var cache = windowcache; cache; cache; cache;}
Note: you need defined cache.put
method in your application.
You can define wrapperTpl
for any case and any frameworks.
amd:
;
angular template cache:
angular;
angular http cache:
angular;
etc.
API
gulpResourceCache(params)
params
Object with the following parameters
root
Type: String
Default: ''
Root path for resource url cache.put(root + url, content)
base
Type: String
Default: file.base
Base path for resource url. It is subtracted from the address of the resource
name
Type: String
Default: 'cached' + extention
Merged file name
cacheTpl
Type: String
Default: 'cache.put("<%= url %>", "<%= contents %>");\n'
Cached resource template
wrapperTpl
Type: String
Default: '<%= contents %>'
Wrapper template
data
Type: Object
Custom data for cacheTpl
and wrapperTpl
License
� Oleg Istomin 2015. Released under the MIT license