WebLoader
WebLoader copied to clipboard
Interface & impl for filters to provide list of files that invalidate the cache
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.
less directory can be watched insted of root file
That's not enough imho. I would preffer to parse the file and find all imports and watch those files.
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.
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.
lessc (https://github.com/janmarek/WebLoader/pull/93) has --depends
option.
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..
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
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.