Skip to content

Commit c8b9d59

Browse files
author
Muntaner
committed
Setup React
0 parents  commit c8b9d59

File tree

4 files changed

+56
-0
lines changed

4 files changed

+56
-0
lines changed

.gitignore

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

index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title></title>
6+
</head>
7+
<body>
8+
<div id="app"></div>
9+
<script src="index.js" charset="utf-8"></script>
10+
</body>
11+
</html>

package.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "react_workshop",
3+
"version": "1.0.0",
4+
"description": "Getting Started with React",
5+
"main": "index.js",
6+
"scripts": {
7+
"start": "webpack-dev-server"
8+
},
9+
"author": "Llorenç Muntaner",
10+
"license": "ISC",
11+
"dependencies": {
12+
"babel-core": "^6.7.7",
13+
"babel-loader": "^6.2.4",
14+
"babel-preset-es2015": "^6.6.0",
15+
"babel-preset-react": "^6.5.0",
16+
"react": "^15.0.2",
17+
"react-dom": "^15.0.2",
18+
"webpack": "^1.13.0",
19+
"webpack-dev-server": "^1.14.1"
20+
}
21+
}

webpack.config.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = {
2+
entry: './main.js',
3+
output: {
4+
path: './',
5+
filename: 'index.js'
6+
},
7+
devServer: {
8+
inline: true, // reload automatically after saving changes
9+
port: 8080
10+
},
11+
module: {
12+
loaders: [
13+
{
14+
test: /\.js$/,
15+
exclude: /node_modules/,
16+
loader: 'babel',
17+
query: {
18+
presets: ['es2015', 'react']
19+
}
20+
}
21+
]
22+
}
23+
};

0 commit comments

Comments
 (0)