Is there a file watcher for assets?

I think I have a very common use case for using less files (my example is based on Bootstrap 3).

I would like to modify the style of my site by adjusting the values in my-variables.less (copy from variables.less) and adding some rules to my-custom.less.

So let’s say I have the following main.less file:




@import '../../vendor/bower/twbs/less/bootstrap.less'

@import 'my-variables.less'

@import 'my-custom.less'

With eg. grunt or other build tools I have the possibility to watch the files above, which includes the feature, that if my-variables.less or my-custom.less changes - main.less will get recompiled.

How does Yii2 work in this case?

…does the asset manager automatically detects any change, also from imported files and recompiles them on the next request.

…is there a way to run the asset command triggered by a file watcher if any of the imported files are changed.

…do I have to run the asset-command manually every time I made a change.

Asset manager is not a watcher. If you’re using one it’s probably better to use generated CSS instead of converting LESS via Yii asset manager.