Added webpack, babel and react. Basic client setup
parent
175b4c1b8e
commit
6b5633dd0b
@ -0,0 +1,10 @@
|
||||
import React from 'react';
|
||||
import {render} from 'react-dom';
|
||||
|
||||
class App extends React.Component {
|
||||
render () {
|
||||
return <p> Hello React!</p>;
|
||||
}
|
||||
}
|
||||
|
||||
render(<App/>, document.getElementById('app'));
|
@ -0,0 +1,14 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Matterwiki</title>
|
||||
</head>
|
||||
<body>
|
||||
<!--
|
||||
This is the main index file which just imports the
|
||||
compiled react files and holds the app container div.
|
||||
-->
|
||||
<div id="app" />
|
||||
<script src="public/bundle.js" type="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
@ -0,0 +1,24 @@
|
||||
var webpack = require('webpack');
|
||||
var path = require('path');
|
||||
|
||||
var BUILD_DIR = path.resolve(__dirname, 'client/public');
|
||||
var APP_DIR = path.resolve(__dirname, 'client/app');
|
||||
|
||||
var config = {
|
||||
entry: APP_DIR + '/index.jsx',
|
||||
output: {
|
||||
path: BUILD_DIR,
|
||||
filename: 'bundle.js'
|
||||
},
|
||||
module : {
|
||||
loaders : [
|
||||
{
|
||||
test : /\.jsx?/,
|
||||
include : APP_DIR,
|
||||
loader : 'babel'
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = config;
|
Loading…
Reference in New Issue