gulp-transform-cache
v1.1.1
Published
![Language](https://img.shields.io/badge/-TypeScript-blue.svg) [![Build Status](https://travis-ci.org/searchfe/gulp-transform-cache.svg?branch=master)](https://travis-ci.org/searchfe/gulp-transform-cache) [![Coveralls](https://img.shields.io/coveralls/sea
Downloads
18
Readme
gulp-transform-cache
提供一个自动cache的transform,其API同readable-stream
How to use
1、编写的Gulp插件管道继承本包export的transform即可
2、生产环境中设置process.env.build_cache = "open"
打开cache
3、插件需要使用callback来返回流,否则该插件不生效cache
4、如果该流返回的文件有其他依赖,请在返回的file文件上附带depFiles: string[]来标明依赖文件的绝对路径
class Pipe extends Transform {};
const pipe = new Pipe({
objectMode: true,
transform: (file: File, enc, callback) => {
file.depFiles = ['/home/work/xxxxx/xxxx/a.js', '/home/work/xxxxx/xxxx/b.js'];
callback(null, file);
}
});
Develop
写入以下内容到配置文件(dev.config.js):
module.exports = {
packages: [
// '/Users/xxx/www-wise/amd_modules',
'/Users/xxx/www-wise/node_modules'
]
};
执行 npm run watch:dev
即可进入watch+deploy模式