| @@ -0,0 +1,10 @@ | ||
| <html> | ||
| <head> | ||
| <meta charset="utf-8"> | ||
| <title>Rowboat GUI</title> | ||
| </head> | ||
| <body> | ||
| <div id="main"></div> | ||
| <script type="text/javascript" src="dist/bundle.js" charset="utf-8"></script> | ||
| </body> | ||
| </html> |
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "name": "rowboatgui", | ||
| "version": "0.0.1", | ||
| "description": "", | ||
| "main": "index.js", | ||
| "scripts": {}, | ||
| "author": "", | ||
| "license": "ISC", | ||
| "dependencies": { | ||
| "babel-core": "^6.4.5", | ||
| "babel-loader": "^6.2.1", | ||
| "css-loader": "^0.23.1", | ||
| "jquery": "^2.2.0", | ||
| "jsx-loader": "^0.13.2", | ||
| "less": "^2.6.0", | ||
| "less-loader": "^2.2.2", | ||
| "react": "^0.14.7", | ||
| "react-dom": "^0.14.7", | ||
| "style-loader": "^0.13.0", | ||
| "webpack": "^2.0.6-beta", | ||
| "webpack-dev-server": "^1.14.1" | ||
| } | ||
| } |
| @@ -0,0 +1,15 @@ | ||
| var React = require('react'); | ||
| var ReactDOM = require('react-dom'); | ||
|
|
||
| //module.exports = "It works from content.js."; | ||
| var CommentBox = React.createClass({ | ||
| render: () => { | ||
| return ( | ||
| <div className="commentBox"> | ||
| Hello, world! I am a CommentBox. | ||
| </div> | ||
| ); | ||
| } | ||
| }); | ||
|
|
||
| ReactDOM.render(<CommentBox />, document.getElementById('main')); |
| @@ -0,0 +1,12 @@ | ||
| module.exports = "It works from content.js."; | ||
| var CommentBox = React.createClass({ | ||
| render: function() { | ||
| return ( | ||
| <div className="commentBox"> | ||
| Hello, world! I am a CommentBox. | ||
| </div> | ||
| ); | ||
| } | ||
| }); | ||
|
|
||
| React.renderComponent(<CommentBox />, document.body); |
| @@ -0,0 +1,4 @@ | ||
| require("./style.less"); | ||
| var jquery = require('jquery'); | ||
|
|
||
| require("./content.js"); |
| @@ -0,0 +1,3 @@ | ||
| body { | ||
| background: yellow; | ||
| } |
| @@ -0,0 +1,34 @@ | ||
| var webpack = require("webpack"); | ||
|
|
||
| module.exports = { | ||
| entry: { | ||
| app: "./src/main.js", | ||
| }, | ||
| output: { | ||
| path: __dirname, | ||
| filename: "dist/bundle.js" | ||
| }, | ||
| module: { | ||
| loaders: [ | ||
| { | ||
| test: /\.less$/, | ||
| loader: "style!css!less" | ||
| }, | ||
| { | ||
| test: /\.js$/, | ||
| loaders: [ 'jsx', 'babel' ], | ||
| exclude: /node_modules/ | ||
| } | ||
| ] | ||
| }, | ||
| plugins: [ | ||
| new webpack.ProvidePlugin({ | ||
| React: "react", | ||
| "window.React": "react", | ||
| ReactDOM: 'react-dom', | ||
| $: "jquery", | ||
| jQuery: "jquery", | ||
| "windows.jQuery": "jquery" | ||
| }) | ||
| ] | ||
| }; |