mirror of
https://github.com/penpot/penpot.git
synced 2026-02-12 14:42:56 +00:00
Restructure build scripts for facilitate incorporate more apps.
This commit is contained in:
@@ -5,11 +5,11 @@
|
||||
(let [start (System/nanoTime)]
|
||||
(b/build
|
||||
(b/inputs "src" "vendor")
|
||||
{:main 'uxbox-worker.main
|
||||
{:main 'uxbox.worker
|
||||
:output-to "resources/public/js/worker.js"
|
||||
:output-dir "resources/public/js/worker"
|
||||
:asset-path "js"
|
||||
:parallel-build false
|
||||
:parallel-build true
|
||||
:optimizations :simple
|
||||
:static-fns true
|
||||
:language-in :ecmascript6
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
#!/bin/sh
|
||||
lein trampoline run -m clojure.main scripts/build-worker.clj
|
||||
lein trampoline run -m clojure.main scripts/dist.clj
|
||||
|
||||
SCRIPT=$(readlink -f $0)
|
||||
SCRIPTPATH=`dirname $SCRIPT`
|
||||
|
||||
NODE_ENV=production gulp dist
|
||||
$SCRIPTPATH/dist-main
|
||||
$SCRIPTPATH/dist-worker
|
||||
|
||||
2
scripts/dist-main
Executable file
2
scripts/dist-main
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
lein trampoline run -m clojure.main scripts/dist-main.clj
|
||||
@@ -6,17 +6,17 @@
|
||||
(b/build
|
||||
(b/inputs "src" "vendor")
|
||||
{:main 'uxbox.main
|
||||
:parallel-build false
|
||||
:parallel-build true
|
||||
:warnings {:ns-var-clash false}
|
||||
:output-to "resources/public/js/main.js"
|
||||
:output-dir "resources/public/js"
|
||||
:closure-defines {"uxbox.repo.core.url"
|
||||
:output-to "dist/js/main.js"
|
||||
:output-dir "dist/js"
|
||||
:closure-defines {"uxbox.common.constants.url"
|
||||
"https://test.uxbox.io/api"}
|
||||
:optimizations :simple
|
||||
:externs ["externs/main.js"]
|
||||
:source-map "resources/public/js/main.js.map"
|
||||
:source-map "dist/js/main.js.map"
|
||||
:static-fns true
|
||||
:pretty-print true
|
||||
:pretty-print false
|
||||
:language-in :ecmascript6
|
||||
:language-out :ecmascript5
|
||||
:verbose true})
|
||||
2
scripts/dist-worker
Executable file
2
scripts/dist-worker
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
lein trampoline run -m clojure.main scripts/dist-worker.clj
|
||||
19
scripts/dist-worker.clj
Normal file
19
scripts/dist-worker.clj
Normal file
@@ -0,0 +1,19 @@
|
||||
(require '[cljs.build.api :as b])
|
||||
|
||||
(println "Building ...")
|
||||
|
||||
(let [start (System/nanoTime)]
|
||||
(b/build
|
||||
(b/inputs "src" "vendor")
|
||||
{:main 'uxbox.worker
|
||||
:output-to "dist/js/worker.js"
|
||||
:output-dir "dist/js/worker"
|
||||
:source-map "dist/js/worker.js.map"
|
||||
:asset-path "js"
|
||||
:parallel-build true
|
||||
:optimizations :simple
|
||||
:static-fns true
|
||||
:language-in :ecmascript6
|
||||
:language-out :ecmascript5
|
||||
:verbose true})
|
||||
(println "... done. Elapsed" (/ (- (System/nanoTime) start) 1e9) "seconds"))
|
||||
@@ -8,45 +8,21 @@
|
||||
:build-ids ["main", "preview"]
|
||||
:all-builds
|
||||
[{:id "main"
|
||||
:figwheel {:on-jsload "uxbox.ui/init"}
|
||||
:figwheel {:on-jsload "uxbox.main.ui/init"}
|
||||
:source-paths ["src" "vendor"]
|
||||
:compiler
|
||||
{:main 'uxbox.main
|
||||
:asset-path "js"
|
||||
:parallel-build true
|
||||
:optimizations :none
|
||||
;; :closure-defines {"uxbox.repo.core.url"
|
||||
;; "https://test.uxbox.io/api"}
|
||||
:closure-defines {"uxbox.repo.core.url"
|
||||
"http://localhost:6060/api"}
|
||||
:closure-defines {"uxbox.common.constants.url"
|
||||
"https://test.uxbox.io/api"}
|
||||
:warnings {:ns-var-clash false}
|
||||
:pretty-print true
|
||||
:language-in :ecmascript6
|
||||
:language-out :ecmascript5
|
||||
:output-to "resources/public/js/main.js"
|
||||
:output-dir "resources/public/js"
|
||||
:verbose true}}
|
||||
#_{:id "preview"
|
||||
;; :figwheel {:on-jsload "uxbox.ui/init"}
|
||||
:source-paths ["src" "vendor"]
|
||||
:compiler
|
||||
{:main 'uxbox.core
|
||||
:asset-path "js"
|
||||
:parallel-build false
|
||||
:optimizations :none
|
||||
;; :closure-defines {"uxbox.repo.core.url"
|
||||
;; "https://test.uxbox.io/api"}
|
||||
:closure-defines {"uxbox.repo.core.url"
|
||||
"http://localhost:6060/api"}
|
||||
:warnings {:ns-var-clash false}
|
||||
:pretty-print true
|
||||
:language-in :ecmascript6
|
||||
:language-out :ecmascript5
|
||||
:output-to "resources/public/preview/js/main.js"
|
||||
:output-dir "resources/public/preview/js"
|
||||
:verbose true}}
|
||||
|
||||
|
||||
]})
|
||||
]})
|
||||
|
||||
(ra/cljs-repl "main")
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
(b/watch
|
||||
(b/inputs "src" "vendor")
|
||||
{:main 'uxbox-worker.main
|
||||
{:main 'uxbox.worker.main
|
||||
:output-to "resources/public/js/worker.js"
|
||||
:output-dir "resources/public/js/worker"
|
||||
:asset-path "js"
|
||||
|
||||
Reference in New Issue
Block a user