Skip to content

Commit

Permalink
use foreign-libs to include bundle in build
Browse files Browse the repository at this point in the history
  • Loading branch information
tomerweller committed Jun 18, 2017
1 parent 6872cae commit 76aae05
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 29 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "zefstyle",
"version": "0.0.1",
"version": "0.0.2",
"author": "[email protected]",
"scripts": {
"watch": "webpack -d --watch",
"build": "webpack -p"
},
"dependencies": {
"react": "15.1.0",
"react-dom": "15.1.0",
"react": "15.5.4",
"react-dom": "15.5.4",
"webpack": "1.13.1",
"react-player": "0.7.3"
"react-player": "0.18.0"
}
}
}
44 changes: 24 additions & 20 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
:url "http://www.eclipse.org/legal/epl-v10.html"}

:dependencies [[org.clojure/clojure "1.8.0" :scope "provided"]
[org.clojure/clojurescript "1.9.36" :scope "provided"]
[reagent "0.6.0-rc" :exclusions [cljsjs/react cljsjs/react-dom]]]
[org.clojure/clojurescript "1.9.562" :scope "provided"]
[reagent "0.6.2" :exclusions [cljsjs/react cljsjs/react-dom]]]

:plugins [[lein-cljsbuild "1.1.3"]
[lein-figwheel "0.5.4-SNAPSHOT"]]
:plugins [[lein-cljsbuild "1.1.6"]
[lein-figwheel "0.5.10"]]

:min-lein-version "2.5.0"

:clean-targets ^{:protect false}
[:target-path
[:cljsbuild :builds :app :compiler :output-dir]
[:cljsbuild :builds :app :compiler :output-to]]
[:target-path
[:cljsbuild :builds :app :compiler :output-dir]
[:cljsbuild :builds :app :compiler :output-to]]

:resource-paths ["public"]

Expand All @@ -28,24 +28,28 @@
:cljsbuild {:builds {:app
{:source-paths ["src" "env/dev/cljs"]
:compiler
{:main "zefstyle.dev"
:output-to "public/js/app.js"
:output-dir "public/js/out"
:asset-path "js/out"
:source-map true
:optimizations :none
:pretty-print true}}
{:main "zefstyle.dev"
:output-to "public/js/app.js"
:output-dir "public/js/out"
:asset-path "js/out"
:source-map true
:foreign-libs [{:file "public/js/bundle.js"
:provides ["cljsjs.react" "cljsjs.react.dom" "webpack.bundle"]}]
:optimizations :none
:pretty-print true}}
:release
{:source-paths ["src" "env/prod/cljs"]
:compiler
{:output-to "public/js/app.js"
:output-dir "public/js/release"
:asset-path "js/out"
:optimizations :advanced
:pretty-print false}}}}
{:output-to "public/js/app.js"
:output-dir "public/js/release"
:asset-path "js/out"
:optimizations :advanced
:foreign-libs [{:file "public/js/bundle.js"
:provides ["cljsjs.react" "cljsjs.react.dom" "webpack.bundle"]}]
:pretty-print false}}}}

:aliases {"release" ["do" "clean" ["cljsbuild" "once" "release"]]}

:profiles {:dev {:dependencies [[lein-figwheel "0.5.4-SNAPSHOT"]
[org.clojure/tools.nrepl "0.2.12"]
[com.cemerick/piggieback "0.2.2-SNAPSHOT"]]}})
[com.cemerick/piggieback "0.2.2-SNAPSHOT"]]}})
1 change: 0 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<h3>ClojureScript has not been compiled!</h3>
<p>please run <b>lein figwheel</b> in order to start the compiler</p>
</div>
<script src="js/bundle.js" type="text/javascript"></script>
<script src="js/app.js" type="text/javascript"></script>
</body>
</html>
1 change: 0 additions & 1 deletion src/cljsjs/react.cljs

This file was deleted.

1 change: 0 additions & 1 deletion src/cljsjs/react/dom.cljs

This file was deleted.

3 changes: 2 additions & 1 deletion src/zefstyle/core.cljs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(ns zefstyle.core
(:require [reagent.core :as reagent :refer [atom]]))
(:require [reagent.core :as reagent :refer [atom]]
[webpack.bundle]))

;; -------------------------
;; Views
Expand Down

0 comments on commit 76aae05

Please sign in to comment.