forked from reagent-project/reagent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
project.clj
173 lines (155 loc) · 6.81 KB
/
project.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
(defproject reagent "0.8.2-SNAPSHOT"
:url "http://github.com/reagent-project/reagent"
:license {:name "MIT"}
:description "A simple ClojureScript interface to React"
:dependencies [[org.clojure/clojure "1.9.0"]
;; If :npm-deps enabled, these are used only for externs.
;; Without direct react dependency, other packages,
;; like react-leaflet might have closer dependency to a other version.
[cljsjs/react "16.4.1-0"]
[cljsjs/react-dom "16.4.1-0"]
[cljsjs/react-dom-server "16.4.1-0"]
[cljsjs/create-react-class "15.6.3-1"]]
:plugins [[lein-cljsbuild "1.1.7"]
[lein-doo "0.1.10"]
[lein-codox "0.10.3"]
[lein-figwheel "0.5.16"]]
:source-paths ["src"]
:codox {:language :clojurescript
:exclude clojure.string
:source-paths ["src"]}
:profiles {:dev {:dependencies [[org.clojure/clojurescript "1.10.312"]
[figwheel "0.5.16"]
[doo "0.1.10"]
[cljsjs/prop-types "15.6.2-0"]]
:source-paths ["demo" "test" "examples/todomvc/src" "examples/simple/src" "examples/geometry/src"]
:resource-paths ["site" "target/cljsbuild/client" "target/cljsbuild/client-npm"]}}
:clean-targets ^{:protect false} [:target-path :compile-path "out"]
:figwheel {:http-server-root "public" ;; assumes "resources"
:css-dirs ["site/public/css"]
:repl false}
;; No profiles and merging - just manual configuration for each build type.
;; For :optimization :none ClojureScript compiler will compile all
;; cljs files in source-paths. To ensure unncessary files
;; aren't compiled it would be better to not provide source-paths or
;; provide single file but currently this doesn't work for Cljsbuild.
;; In future :main alone should be enough to find entry file.
:cljsbuild
{:builds
[{:id "client"
:source-paths ["demo"]
:watch-paths ["src" "demo" "test"]
:figwheel true
:compiler {:parallel-build true
:optimizations :none
:main "reagentdemo.dev"
:output-dir "target/cljsbuild/client/public/js/out"
:output-to "target/cljsbuild/client/public/js/main.js"
:asset-path "js/out"
:npm-deps false}}
{:id "client-npm"
:source-paths ["demo"]
:watch-paths ["src" "demo" "test"]
:figwheel true
:compiler {:parallel-build true
:optimizations :none
:main "reagentdemo.dev"
:output-dir "target/cljsbuild/client-npm/public/js/out"
:output-to "target/cljsbuild/client-npm/public/js/main.js"
:asset-path "js/out"}}
{:id "test"
:source-paths ["test"]
:compiler {:parallel-build true
:optimizations :none
:main "reagenttest.runtests"
:asset-path "js/out"
:output-dir "target/cljsbuild/test/out"
:output-to "target/cljsbuild/test/main.js"
:npm-deps false
:aot-cache true}}
{:id "test-npm"
:source-paths ["test"]
:compiler {:parallel-build true
:optimizations :none
:main "reagenttest.runtests"
:asset-path "js/out"
:output-dir "target/cljsbuild/test-npm/out"
:output-to "target/cljsbuild/test-npm/main.js"
:aot-cache true}}
;; Separate source-path as this namespace uses Node built-in modules which
;; aren't available for other targets, and would break other builds.
{:id "prerender"
:source-paths ["prerender"]
:compiler {:main "sitetools.prerender"
:target :nodejs
:output-dir "target/cljsbuild/prerender/out"
:output-to "target/cljsbuild/prerender/main.js"
:aot-cache true}}
{:id "node-test"
:source-paths ["test/reagenttest/runtests.cljs"]
:watch-paths ["src" "test"]
:compiler {:main "reagenttest.runtests"
:target :nodejs
:parallel-build true
:optimizations :none
:output-dir "target/cljsbuild/node-test/out"
:output-to "target/cljsbuild/node-test/main.js"
:npm-deps false
:aot-cache true}}
{:id "node-test-npm"
:source-paths ["test/reagenttest/runtests.cljs"]
:watch-paths ["src" "test"]
:compiler {:main "reagenttest.runtests"
:target :nodejs
:parallel-build true
:optimizations :none
:output-dir "target/cljsbuild/node-test-npm/out"
:output-to "target/cljsbuild/node-test-npm/main.js"
:aot-cache true}}
;; With :advanched source-paths doesn't matter that much as
;; Cljs compiler will only read :main file.
{:id "prod"
:source-paths ["demo"]
:compiler {:main "reagentdemo.prod"
:optimizations :advanced
:elide-asserts true
:pretty-print false
;; :pseudo-names true
:stable-names true
:output-to "target/cljsbuild/prod/public/js/main.js"
:output-dir "target/cljsbuild/prod/out" ;; Outside of public, not published
:npm-deps false
:aot-cache true}}
{:id "prod-npm"
:source-paths ["demo"]
:compiler {:main "reagentdemo.prod"
:optimizations :advanced
:elide-asserts true
:pretty-print false
:stable-names true
:output-to "target/cljsbuild/prod-npm/public/js/main.js"
:output-dir "target/cljsbuild/prod-npm/out" ;; Outside of public, not published
:closure-warnings {:global-this :off}
:aot-cache true}}
{:id "prod-test"
:source-paths ["test"]
:compiler {:main "reagenttest.runtests"
:optimizations :advanced
:elide-asserts true
:pretty-print false
:output-to "target/cljsbuild/prod-test/main.js"
:output-dir "target/cljsbuild/prod-test/out"
:closure-warnings {:global-this :off}
:npm-deps false
:aot-cache true}}
{:id "prod-test-npm"
:source-paths ["test"]
:compiler {:main "reagenttest.runtests"
:optimizations :advanced
:elide-asserts true
:pretty-print false
;; :pseudo-names true
:output-to "target/cljsbuild/prod-test-npm/main.js"
:output-dir "target/cljsbuild/prod-test-npm/out"
:closure-warnings {:global-this :off}
:aot-cache true}}]})