Permalink
Browse files

works up until: We now have a functioning react app! We can start our…

… dev server by executing webpack-dev-server --mode development in the terminal.
  • Loading branch information...
stnbu committed Sep 17, 2018
1 parent 128d67a commit 3cec343e103a61f64397c18deb26954e849a5001
Showing with 12,175 additions and 1 deletion.
  1. +3 −0 .babelrc
  2. +12,080 −0 package-lock.json
  3. +17 −1 package.json
  4. +16 −0 public/index.html
  5. +4 −0 src/App.css
  6. +14 −0 src/App.js
  7. +7 −0 src/index.js
  8. +34 −0 webpack.config.js
@@ -0,0 +1,3 @@
{
"presets": ["env", "react"]
}

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -7,5 +7,21 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
"license": "ISC",
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"css-loader": "^0.28.11",
"style-loader": "^0.21.0",
"webpack": "^4.8.3",
"webpack-cli": "^2.1.3",
"webpack-dev-server": "^3.1.4"
},
"dependencies": {
"react": "^16.4.1",
"react-dom": "^16.4.1"
}
}
@@ -0,0 +1,16 @@
<!-- sourced from https://raw.githubusercontent.com/reactjs/reactjs.org/master/static/html/single-file-example.html -->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>React Starter</title>
</head>
<body>
<div id="root"></div>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<script src="../dist/bundle.js"></script>
</body>
</html>
@@ -0,0 +1,4 @@
.App {
margin: 1rem;
font-family: Arial, Helvetica, sans-serif;
}
@@ -0,0 +1,14 @@
import React, { Component} from "react";
import "./App.css";
class App extends Component{
render(){
return(
<div className="App">
<h1> Hello, World! </h1>
</div>
);
}
}
export default App;
@@ -0,0 +1,7 @@
import React from "react";
import ReactDOM from "react-dom";
import App from "./App.js";
ReactDOM.render(
<App />,
document.getElementById("root")
);
@@ -0,0 +1,34 @@
const path = require("path");
const webpack = require("webpack");
module.exports = {
entry: "./src/index.js",
mode: "development",
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
options: { presets: ['env'] }
},
{
test: /\.css$/,
use: [ 'style-loader', 'css-loader' ]
}
]
},
resolve: { extensions: ['*', '.js', '.jsx'] },
output: {
path: path.resolve(__dirname, "dist/"),
publicPath: "/dist/",
filename: "bundle.js"
},
devServer: {
contentBase: path.join(__dirname, "public/"),
port: 3000,
publicPath: "http://localhost:3000/dist/",
hotOnly: true
},
plugins: [ new webpack.HotModuleReplacementPlugin() ]
};

0 comments on commit 3cec343

Please sign in to comment.