Dan503 / gulp-auto-imports

Auto generate import-only files for any file type. SCSS, JS, TS, Pug, whatever you want.
MIT License
1 stars 0 forks source link

Only run file generation if circumstances change #3

Closed Dan503 closed 6 years ago

Dan503 commented 6 years ago

At the moment gulp-file-generator will run every time it is called no matter what, even if the file it generates is no different to what it was before.

It would be good if it can do some sort of check to see if it is worth regenerating the file. This will help improve performance.

I'm thinking that it should compare the new list of imports to an old list of imports. If they match then it is not worth regenerating the file.

Dan503 commented 6 years ago

I gave fixing this issue a shot.

I successfully managed to get the compiler to only run if the paths matched, but then I completely changed the format of the output and it didn't change the format of the output because the paths were still all the same. 😖

I'm closing this issue. The only way I can make sure that the output is different is if I go almost all the way to creating the file but then stop just short of outputting something. It's not really worth it considering how fast it's able to generate the file.

Dan503 commented 6 years ago

Changed my mind, not writing to disc is worth it

Dan503 commented 6 years ago

Fixed in v2.0.0