Skip to content

Commit

Permalink
add webpack configuration file
Browse files Browse the repository at this point in the history
  • Loading branch information
temilaj committed May 21, 2017
1 parent 672710e commit d02a004
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 4 deletions.
4 changes: 1 addition & 3 deletions .gitignore
@@ -1,5 +1,3 @@
.vscode/
node_modules/
dist/
src/
index.html
dist/
12 changes: 12 additions & 0 deletions index.html
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>React Webpack starter</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div id="root"></div>
<script src="/dist/bundle.js"></script>
</body>
</html>
6 changes: 5 additions & 1 deletion package.json
Expand Up @@ -2,7 +2,11 @@
"name": "react-webpack-starter",
"version": "1.0.0",
"description": "a boiler plate for creating react applications bundled by webpack",
"main": "js/app.js",
"main": "src/js/app.js",
"scripts": {
"start": "webpack-dev-server --entry ./src/js/app.js --output-filename ./dist/bundle.js",
"build": "webpack"
},
"repository": "https://github.com/temilaj/react-webpack-starter.git",
"author": "Temi Lajumoke <temi@temilajumoke.com>",
"license": "MIT",
Expand Down
2 changes: 2 additions & 0 deletions src/js/app.js
@@ -0,0 +1,2 @@
import React from 'react';
import ReactDOM from 'react-dom';
19 changes: 19 additions & 0 deletions webpack.config.js
@@ -0,0 +1,19 @@
module.exports = {
entry: './src/js/app.js',
output: {
path: `${__dirname}/dist` ,
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets:['es2015','react']
}
}
]
}
}

0 comments on commit d02a004

Please sign in to comment.