Closed xixixao closed 10 years ago
The thinking around only doing the compile on build
is that when you are just watch
ing you are able to serve them templates dynamically via mimosa-server
. Transforming them to .html
files is only needed when leaving Mimosa behind and taking code someplace where dynamic views can't be used.
So what is the use case to not being using the dynamic templates during watch
?
I want to use the dynamic templates during watch. The problem is that taking the website and putting it on a server, let's say, breaks the build directory.
My use case is rather dumb, because I needed to test on mobile device, so I was just periodically pushing the static version out to a server, instead of just connecting to my localhost. I guess the main problem is that you can't easily build into a different directory (or can you?). Otherwise you have to:
html
version)You might not be doing this often, but it still annoying (and quite a hidden bug, because all you see is that the index is not updating).
You could use build profiles to redirect builds.
So mimosa build -omp -P mobile
and inside profiles/mobile.coffee
you'd have something like...
watch:
compiledDir:'../someplace/else`
Is that what you are talking about?
Ah, profiles, perfect. Thanks for your patience!
When using this module, mimosa doesn't compile the
jade
intohtml
onwatch
, only onbuild
. After usingbuild
though,index.html
is served by the Mimosa embedded server and hence LiveReload breaks.Maybe the easiest fix would be to compile the html on watch? If that's not desirable (speed, some jade functionality), what would be the easiest way to compile these files into a separate folder (I am thinking
dist
withindex.html
and rest of assets andbuild
without the html) during watch?