gulp-community / gulp-cached

A simple in-memory file cache for gulp
MIT License
452 stars 23 forks source link

Support for ignoring certain files #14

Closed jordond closed 8 years ago

jordond commented 8 years ago

I am currently using gulp-cached with typescript so that I can speed up the compilation of my code.

However the index of my application references a dts.d.ts file, which is the source definitions for the compiler. And since this file never changes, it is never processed by gulp-cached, which causes the compiler to break down and not work.

Now I could add a reference to my dts.d.ts file in every single one of my source files, but that is tedious and annoying. So I currently use a hacky way to always process the definition file.

var cache = $.cached.caches['compile-typescript'];
 if (cache) {
   delete cache[''typings/dts.d.ts']
 }

It works, but It would be nice if I could just pass that file to gulp-cached so it will always allow it through.

yocontra commented 8 years ago

Use the gulp-if plugin to solve this

yocontra commented 8 years ago
.pipe(gif('!typings/dts.d.ts', cache('stuff')))