1

Wro4j (Web Resource Optimizer for Java) make it easier for Java web developers to use things like SCSS / LESS / CoffeeScript / UglifyJS in their projects, without using the gems / npms directly.

I couldn't find though how do I use it for the simple use case of watching some SCSS files

What is the quickest equivalent to

sass --watch /src:/css

In wro4j?

Eran Medan
  • 44,555
  • 61
  • 184
  • 276
  • By the way, my preferred solution is just using the sass gem directly, but I need to support people who don't have Ruby / Gem installed... – Eran Medan Aug 26 '12 at 23:50

1 Answers1

1

I assume it is related to change detection. If it is true, than there is a configuration property called "resourceWatcherUpdatePeriod" which is used to check periodically resources for change. The next release (1.4.9) will improve the behavior of resourceWatcher by watching for change lazily.

Alex Objelean
  • 3,893
  • 2
  • 27
  • 36
  • Does this parameter still take effect if one is using wro4j at build time? I'm finding that it doesn't seem be updating the generated files after it initially parses them as part of the generate resources target it seems to have finished working as the maven build is complete. Does this resourceWatcher only work at if using wro4j at runtime? – Caroline May 02 '13 at 14:05
  • Yes, it works only for runtime solution. For build time solution I recommend m2e-wro4j eclipse plugin which has support for incremental change (similar to resourceWatcher for runtime solution) – Alex Objelean May 03 '13 at 09:38
  • Many thanks for that but I'm trying to develop using the command line only (i.e. not tie my development to an IDE). I'm guessing this plugin is specific to eclipse and cannot be used solely as a maven / command line solution - do you have any suggestions for this? – Caroline May 09 '13 at 08:52
  • If you need an IDE agnostic tool, there should be a daemon process which would monitor the changes and would trigger some process when a change is detected. This is exactly what m2e-wro4j and wro4j-maven-plugin does. You could open an issue describing your use-case and it will be handled at some point in the future. – Alex Objelean May 11 '13 at 20:12
  • Many thanks for this Alex, I will see whether I can get that plugin working without the use of eclipse (sorry, I didn't realise it could be used without an IDE). Thanks! – Caroline May 15 '13 at 08:29