Development mode, live reload and libs

Continuing the discussion from Enonic XP deverlopment mode with Sass and ES6:

ASFAIK When XP is running in development mode, files are read directly from the src directory, and the build folder???

The reason I’m saying this is that our transpilation from es6 to js puts files in build, not in src.
In other words there are no js files in src. Only es6 files which XP does not use.

Is this a correct assumption:
When a file is changed, either in src or in build, the file with the newest timestamp will be used?
And this goes for all filetypes (xml, js, html)

If that is a correct assumption I can simply make gulp watch copy/transpile files from various xp-libs into the build folder of the app and voila live-reload should work for libs aswell?

One challenge will be dependencies in libs build.gradle, as in sub dependancies.

Including all dependancies of libs in the app build.gradle file should work, but might mean the same lib several times in the jar file (for non development mode build)

Since a real build of the app is installed, it looks like there is no need to include all the sub dependancies.

Yes, it’s read from build folder and source folder (by default). The gradle-plugin sets a X-SOURCE-DIRS header that the XP server looks for in dev-mode. You can tweak this one if you want. Just build your project and look at MANIFEST.MF file to see what values are set.