WebLoader icon indicating copy to clipboard operation
WebLoader copied to clipboard

Interface & impl for filters to provide list of files that invalidate the cache

Open fprochazka opened this issue 9 years ago • 8 comments

The less (and others) can @import other files, but webloader is watching only the root file. This means that the cache is not invalidate in such case.

fprochazka avatar Oct 12 '14 23:10 fprochazka

less directory can be watched insted of root file

janmarek avatar Oct 21 '14 16:10 janmarek

That's not enough imho. I would preffer to parse the file and find all imports and watch those files.

fprochazka avatar Oct 21 '14 16:10 fprochazka

It is much simpler then parsing less files and I think it would be ok for most users. Gulp and grunt watch plugin works this way (user specifies paths and file path patterns where files to watch are located). Also watching for directories would be probably faster then parsing in most cases.

janmarek avatar Oct 22 '14 11:10 janmarek

It would definitely be faster, but the files must be parsed anyway, and if lessphp would provide api with list of includes that it found while parsing the file, it would be ideal.

fprochazka avatar Dec 16 '14 19:12 fprochazka

lessc (https://github.com/janmarek/WebLoader/pull/93) has --depends option.

JanTvrdik avatar Mar 08 '15 06:03 JanTvrdik

what's the current status of this? anybody working on this? I noticed a PR #98 implementing watch which @janmarek mentioned as a possible solution for this..

Ciki avatar Jun 08 '15 14:06 Ciki

I've fixed an issue with dependent LESS files. Webloader now detects changes made in files imported using @import. http://forum.nette.org/cs/2578-addon-webloader-extras-webloader?p=7#p160136

Jeriiii avatar Aug 02 '15 08:08 Jeriiii

Initial support added in https://github.com/janmarek/WebLoader/commit/a5575b7cf332db1e18ca8dc861af524241d746a6. I'm not sure if this can be considered a final solution, but it should work nicely at least for simple use-cases.

fprochazka avatar Sep 07 '15 00:09 fprochazka