Skip to content

Commit

Permalink
Project setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Goutay committed Feb 27, 2016
1 parent 06cacd1 commit 9e2d23c
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 0 deletions.
11 changes: 11 additions & 0 deletions dist/index.html
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>React TodoMVC</title>
</head>
<body>
<div id="app"></div>
<script src="bundle.js"></script>
</body>
</html>
45 changes: 45 additions & 0 deletions package.json
@@ -0,0 +1,45 @@
{
"name": "redux-todomvc",
"version": "1.0.0",
"description": "Companion repository for the \"Getting Started with React, Redux and Immutable: a Test-Driven TodoMVC Tutorial\" article.",
"main": "index.js",
"scripts": {
"test": "mocha --compilers js:babel-core/register --require ./test/setup.js 'test/**/*.@(js|jsx)'",
"test:watch": "npm run test -- --watch --watch-extensions jsx"
},
"repository": {
"type": "git",
"url": "git+https://github.com/phacks/redux-todomvc.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/phacks/redux-todomvc/issues"
},
"homepage": "https://github.com/phacks/redux-todomvc#readme",
"devDependencies": {
"babel-core": "^6.5.2",
"babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.5.0",
"babel-preset-react": "^6.5.0",
"chai": "^3.5.0",
"chai-immutable": "^1.5.3",
"jsdom": "^8.0.4",
"mocha": "^2.4.5",
"react-hot-loader": "^1.3.0",
"webpack": "^1.12.14",
"webpack-dev-server": "^1.14.1"
},
"babel": {
"presets": [
"es2015",
"react"
]
},
"dependencies": {
"immutable": "^3.7.6",
"react": "^0.14.7",
"react-dom": "^0.14.7"
}
}
1 change: 1 addition & 0 deletions src/index.js
@@ -0,0 +1 @@
console.log('Hello World!');
17 changes: 17 additions & 0 deletions test/setup.js
@@ -0,0 +1,17 @@
import jsdom from 'jsdom';
import chai from 'chai';
import chaiImmutable from 'chai-immutable';

const doc = jsdom.jsdom('<!doctype html><html><body></body></html>');
const win = doc.defaultView;

global.document = doc;
global.window = win;

Object.keys(window).forEach((key) => {
if (!(key in global)) {
global[key] = window[key];
}
});

chai.use(chaiImmutable);
31 changes: 31 additions & 0 deletions webpack.config.js
@@ -0,0 +1,31 @@
var webpack = require('webpack');

module.exports = {
entry: [
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server',
'./src/index.js'
],
module: {
loaders: [{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'react-hot!babel'
}]
},
resolve: {
extensions: ['', '.js', '.jsx']
},
output: {
path: __dirname + '/dist',
publicPath: '/',
filename: 'bundle.js'
},
devServer: {
contentBase: './dist',
hot: true
},
plugins: [
new webpack.HotModuleReplacementPlugin() // Wire in the hot loading plugin
]
};

0 comments on commit 9e2d23c

Please sign in to comment.