Last active
September 18, 2015 03:35
-
-
Save hiiamyes/75d3256931b296d840d8 to your computer and use it in GitHub Desktop.
Webpack + React + CoffeeScript
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
React = require 'react' | |
Hello = require './Hello' | |
React.render <Hello />, document.getElementById('content') |
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
React = require 'react' | |
module.exports = React.createClass({ | |
displayName: 'HelloReact', | |
render: -> | |
return <div>Hi~ I'm Yes</div> | |
}) |
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> | |
<title>Basic Property Grid</title> | |
<script src="../../node_modules/react/dist/react-with-addons.js"></script> | |
</head> | |
<body> | |
<div id="content"> | |
</div> | |
<script type="text/javascript" src="bundle.js"></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
module.exports = { | |
entry: './entry.cjsx', | |
output: { | |
filename: 'bundle.js' | |
}, | |
module: { | |
loaders: [ | |
{ | |
test: /\.cjsx$/, | |
loader: 'coffee-jsx-loader' | |
} | |
] | |
}, | |
externals: { | |
'react': 'React' | |
}, | |
resolve: { | |
extensions: ['', '.js', '.cjsx'] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment