Merge pull request #9 from davesann/reload-paths-clean
:reload-paths option to configure reload directories
This commit is contained in:
commit
cf9c7f8601
|
@ -69,6 +69,10 @@ The following options are supported:
|
||||||
when they are modified. Defaults to true in development, false in
|
when they are modified. Defaults to true in development, false in
|
||||||
production.
|
production.
|
||||||
|
|
||||||
|
* `:reload-paths` -
|
||||||
|
A seq of source paths to reload. Defaults to [\"src\"].
|
||||||
|
Only relevant if :auto-reload? is true.
|
||||||
|
|
||||||
* `:auto-refresh?` -
|
* `:auto-refresh?` -
|
||||||
True if you want your browser to automatically refresh when source
|
True if you want your browser to automatically refresh when source
|
||||||
files are changed. Defaults to false.
|
files are changed. Defaults to false.
|
||||||
|
|
|
@ -36,3 +36,7 @@
|
||||||
"True if stacktraces should be shown for exceptions raised by the handler."
|
"True if stacktraces should be shown for exceptions raised by the handler."
|
||||||
[options]
|
[options]
|
||||||
(:stacktraces? options dev-env?))
|
(:stacktraces? options dev-env?))
|
||||||
|
|
||||||
|
(defn reload-paths
|
||||||
|
[options]
|
||||||
|
(:reload-paths options ["src"]))
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
|
|
||||||
(defn- add-auto-reload [handler options]
|
(defn- add-auto-reload [handler options]
|
||||||
(if (auto-reload? options)
|
(if (auto-reload? options)
|
||||||
(wrap-reload handler)
|
(wrap-reload handler {:dirs (reload-paths options)})
|
||||||
handler))
|
handler))
|
||||||
|
|
||||||
(defn- add-auto-refresh [handler options]
|
(defn- add-auto-refresh [handler options]
|
||||||
|
@ -81,6 +81,7 @@
|
||||||
:browser-uri - the path to browse to when opening a browser
|
:browser-uri - the path to browse to when opening a browser
|
||||||
:stacktraces? - if true, display stacktraces when an exception is thrown
|
:stacktraces? - if true, display stacktraces when an exception is thrown
|
||||||
:auto-reload? - if true, automatically reload source files
|
:auto-reload? - if true, automatically reload source files
|
||||||
|
:reload-paths - seq of src-paths to reload on change - defaults to [\"src\"]
|
||||||
:auto-refresh? - if true, automatically refresh browser when source changes
|
:auto-refresh? - if true, automatically refresh browser when source changes
|
||||||
|
|
||||||
If join? is false, a Server object is returned."
|
If join? is false, a Server object is returned."
|
||||||
|
|
Reference in a new issue