Last active
February 20, 2019 09:19
-
-
Save rotaliator/0fbb7101281d56644b8faa87cbbf5d93 to your computer and use it in GitHub Desktop.
Minimal shadow-cljs app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns example.app | |
(:require [reagent.core :as reagent :refer [atom]])) | |
(defn app [] | |
[:div | |
[:h1 "Shadow cljs!"]]) | |
(defn mount-root [] | |
(reagent/render [app] (.getElementById js/document "app"))) | |
(defn ^:export main [] | |
(mount-root)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link href="/css/style.css" rel="stylesheet" type="text/css"> | |
<link rel="icon" href="https://clojurescript.org/images/cljs-logo-icon-32.png"> | |
<title>Example</title> | |
</head> | |
<body> | |
<div id="app"> | |
</div> | |
<script src="/js/main.js" type="text/javascript"></script> | |
<script>window.onload = function() { example.app.main(); }</script> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:dependencies | |
[[reagent "0.8.1"]] | |
:source-paths | |
["src/cljs"] | |
:builds | |
{:app {:target :browser | |
:output-dir "public/js" | |
:asset-path "/js" | |
:modules {:main {:entries [example.app]}} | |
:devtools | |
{:after-load example.app/main | |
:http-root "public" | |
:http-port 3000} | |
}}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment