Doing another React.JS app for my “Everydays”.
Up and Running with React and Webpack
Main.js
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
var React = require('react'); var Main = React.createClass({ render: function () { return ( <div> Hello World </div> ) } }); React.render(<Main />, document.getElementById('app')); |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
module.exports = { entry: "./app/components/Main.js", output: { path: "./public/", filename: "bundle.js" }, module: { loaders: [ { test: /\.jsx?$/, exclude: /(node_modules|bower_components)/, loader: 'babel' } ] } }; |
|
1 2 3 4 5 6 7 8 9 10 11 12 |
<!doctype html> <html> <head> <meta charset="UTF-8"> <title>React Github Notetaker</title> <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" /> </head> <body> <div id="app"></div> <script src="bundle.js"></script> </body> </html> |