Skip to content

Instantly share code, notes, and snippets.

@st23am
Created January 3, 2016 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save st23am/930cc711451d4b7b672d to your computer and use it in GitHub Desktop.
Save st23am/930cc711451d4b7b672d to your computer and use it in GitHub Desktop.
// Brunch automatically concatenates all files in your
// watched paths. Those paths can be configured at
// config.paths.watched in "brunch-config.js".
//
// However, those files will only be executed if
// explicitly imported. The only exception are files
// in vendor, which are never wrapped in imports and
// therefore are always executed.
// Import dependencies
//
// If you no longer want to use a dependency, remember
// to also remove its path from "config.paths.watched".
import "deps/phoenix_html/web/static/js/phoenix_html";
// Import local files
//
// Local files can be imported directly using relative
// paths "./socket" or full ones "web/static/js/socket".
// import socket from "./socket"
import React from "react";
import ReactDom from "react-dom";
ReactDOM.render(
<h1>Hello, world!</h1>,
document.getElementById('example')
);

mix phoenix.new turn_tracker --sup npm install --save react react-dom mix phoenix.server

¶ ~/src/react/turn_tracker $ mix phoenix.server
[info] Running TurnTracker.Endpoint with Cowboy using http on port 4000
03 Jan 15:25:00 - error: Compiling of web/static/js/app.js failed. web/static/js/app.js: Unexpected token (26:4)
{
"repository": {},
"dependencies": {
"babel-brunch": "^6.0.0",
"brunch": "^2.0.0",
"clean-css-brunch": ">= 1.0 < 1.8",
"css-brunch": ">= 1.0 < 1.8",
"javascript-brunch": ">= 1.0 < 1.8",
"react": "^0.14.5",
"react-dom": "^0.14.5",
"uglify-js-brunch": ">= 1.0 < 1.8"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment