Skip to content

Commit 26804fc

Browse files
committed
init
1 parent de4355d commit 26804fc

18 files changed

+316
-0
lines changed

.babelrc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"presets": ["es2015", "react", "stage-0"],
3+
"env": {
4+
"development": {
5+
"plugins": [
6+
["react-transform", {
7+
"transforms": [{
8+
"transform": "react-transform-hmr",
9+
"imports": ["react"],
10+
"locals": ["module"]
11+
}, {
12+
"transform": "react-transform-catch-errors",
13+
"imports": ["react", "redbox-react"]
14+
}]
15+
}]
16+
]
17+
}
18+
}
19+
}

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = tab
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**/node_modules/
2+
lib
3+
build

.eslintrc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"extends": "airbnb",
3+
"parser": "babel-eslint",
4+
5+
"env": {
6+
"browser": true,
7+
"node": true,
8+
"mocha": true,
9+
"es6": true
10+
},
11+
12+
"globals": {
13+
"$": true
14+
},
15+
16+
"rules": {
17+
"id-length": 0,
18+
"indent": [2, "tab"],
19+
"no-console": 0,
20+
"func-names": 0,
21+
"react/no-multi-comp": 0,
22+
"react/prop-types": 0
23+
}
24+
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
npm-debug.log
3+
build

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4.2.1

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
language: node_js
2+
node_js:
3+
- "4.2.1"
4+
script:
5+
- npm run lint
6+
- npm test

demo/app.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React, { Component } from 'react';
2+
3+
export default class App extends Component {
4+
render() {
5+
return (
6+
<div className="app">
7+
</div>
8+
);
9+
}
10+
}

demo/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import React from 'react';
2+
import { render } from 'react-dom';
3+
import App from './app';
4+
5+
render(<App />, document.getElementById('root'));

devserver.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
const path = require('path');
2+
const express = require('express');
3+
const cors = require('cors');
4+
const morgan = require('morgan');
5+
const webpack = require('webpack');
6+
const config = require('./webpack.config');
7+
8+
const port = 8000;
9+
const app = express();
10+
const compiler = webpack(config);
11+
12+
app.use(morgan('dev'));
13+
app.use(cors());
14+
app.use(express.static(process.cwd()));
15+
16+
app.use(require('webpack-dev-middleware')(compiler, {
17+
publicPath: config.output.publicPath,
18+
stats: {
19+
colors: true,
20+
},
21+
}));
22+
23+
app.use(require('webpack-hot-middleware')(compiler));
24+
25+
app.get('/', (req, res) => {
26+
res.sendFile(path.join(__dirname, 'index.html'));
27+
});
28+
29+
app.listen(port, '0.0.0.0', (err) => {
30+
if (err) {
31+
console.log(err);
32+
return;
33+
}
34+
35+
console.log('Listening at http://0.0.0.0:%s', port);
36+
});

0 commit comments

Comments
 (0)