Closed dsteurer closed 7 years ago
Correspondingly, duct.module.web
should be changed so that the default middleware serves files in the path target/resources/.../public
. (The function core/target-path
should be used in forming this path.)
We can't remove target/resources
from the classpath. As the name implies, that's where we store generated resources.
I do think it's worth using set-refresh-dirs
to set the refresh paths, however, as that also solves another issue that people have had when they've changed the source paths. Adding a line to dev.clj
would make most sense.
Using set-refresh-dirs
sounds good.
I guess instead of target/resources
you would want to compute the path in the same way as duct.core/target-path
. That may not be a problem because it's the same by default.
Unfortunately the target/resources
directory needs to be defined when the JVM starts up, because it needs to be on the classpath. The target-path
should always point to whatever the Leiningen target path is set to.
I believe having
target/resources
in the class path may cause subtle bugs related to reloading. The reason is that some tools like figwheel (as configured induct.module.cljs
) populate this path with.cljc
files (maybe to support source maps). By defaultclojure.tools.namespace.repl/refresh
reloads all clojure files in the class path including those files produced by figwheel. This behavior does not seem desirable because there is no reason to reload these files. Furthermore, it may be a source for bugs if those namespaces were not meant to be reloadable.