Precompile JSX, build with make
This commit is contained in:
parent
54b1aa9c56
commit
6563736fae
|
@ -1,2 +1,4 @@
|
|||
burlesque
|
||||
*.rice-box.go
|
||||
.module-cache
|
||||
server/static/app.js
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
all: jsx cleanup embed build
|
||||
|
||||
check-react:
|
||||
@type jsx >/dev/null 2>&1 || (echo "Please install React.js toolkit:\nnpm install -g react-tools\n" && exit 1)
|
||||
|
||||
jsx: check-react
|
||||
jsx --extension jsx server/static/ server/static/
|
||||
rm -rf server/static/.module-cache
|
||||
|
||||
cleanup:
|
||||
find . -name '.DS_Store' | xargs rm -f
|
||||
|
||||
embed:
|
||||
rice -i ./server embed-go
|
||||
|
||||
build:
|
||||
go build
|
|
@ -6,15 +6,14 @@
|
|||
<meta charset="utf8">
|
||||
<link rel="stylesheet" href="/static/app.css">
|
||||
<script src="http://fb.me/react-0.12.2.js"></script>
|
||||
<script src="http://fb.me/JSXTransformer-0.12.2.js"></script>
|
||||
<script src="/static/app.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1 class="heading">Burlesque v{{.version}} at {{.hostname}}</h1>
|
||||
<div id="dashboard"></div>
|
||||
<script type="text/jsx" src="/static/app.jsx"></script>
|
||||
<script type="text/jsx">
|
||||
<script>
|
||||
React.render(
|
||||
<Dashboard api="http://127.0.0.1:{{.port}}/status" interval={1000} />,
|
||||
React.createElement(Dashboard, {api: "http://127.0.0.1:{{.port}}/status", interval: 1000}),
|
||||
document.getElementById('dashboard')
|
||||
);
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue