gulp-transform-cache
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

gulp-transform-cache

Language Build Status Coveralls npm package npm downloads semantic-release

提供一个自动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模式

API

API DOC

Readme

Keywords

none

Package Sidebar

Install

npm i gulp-transform-cache

Weekly Downloads

3

Version

1.1.1

License

MIT

Unpacked Size

621 kB

Total Files

21

Last publish

Collaborators

  • qiansc