forked from weblab-workshops/skeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
2,779 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,6 @@ | |
}], | ||
"react", | ||
"stage-0" | ||
] | ||
], | ||
"plugins": ["react-hot-loader/babel"] | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
|
||
class App extends React.Component { | ||
|
||
render() { | ||
return ( | ||
<h1>Hello from React!</h1> | ||
); | ||
return ( | ||
<h1>let's get this BREAD!</h1> | ||
); | ||
} | ||
} | ||
ReactDOM.render( | ||
<App/>, | ||
document.getElementById('root') | ||
); | ||
); | ||
|
||
module.hot.accept(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Catbook</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script src="bundle.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
import express from 'express'; | ||
import path from 'path'; | ||
const express = require('express'); | ||
const path = erquire('path);') | ||
|
||
const app = express(); | ||
const publicPath = path.resolve(__dirname, '..', '..', 'public'); | ||
const publicPath = path.resolve(__dirname, '..', '..', 'dist'); | ||
|
||
app.use(express.static(publicPath)); | ||
app.listen(3000, () => { | ||
console.log(`MERN Boilerplate listening on port 3000 and looking in folder ${publicPath}`); | ||
|
||
app.listen(3000, () => { | ||
console.log(`Listening on port 3000 and looking in folder ${publicPath}`); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,51 @@ | ||
const path = require('path'); | ||
const entryFile = path.resolve(__dirname, 'src', 'client', 'app.js'); | ||
const outputDir = path.resolve(__dirname, 'public'); | ||
const entryFile = path.resolve(__dirname, 'src', 'client', 'index.js'); | ||
const outputDir = path.resolve(__dirname, 'dist'); | ||
|
||
const HtmlWebPackPlugin = require("html-webpack-plugin"); | ||
const webpack = require('webpack'); | ||
|
||
const htmlPlugin = new HtmlWebPackPlugin({ | ||
template: "./src/client/public/index.html", | ||
filename: "index.html" | ||
}); | ||
|
||
module.exports = { | ||
entry: ['babel-polyfill', entryFile], | ||
output: { | ||
filename: 'bundle.js', | ||
path: outputDir | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(js|jsx)$/, | ||
loader: 'babel-loader', | ||
exclude: /node_modules/ | ||
} | ||
] | ||
} | ||
entry: ['babel-polyfill', entryFile], | ||
output: { | ||
filename: 'bundle.js', | ||
path: outputDir | ||
}, | ||
module: { | ||
rules: [ | ||
|
||
{ | ||
test: /\.(js|jsx)$/, | ||
loader: 'babel-loader', | ||
exclude: /node_modules/ | ||
}, | ||
{ | ||
test: /\.(scss|css)$/, | ||
use: [ | ||
{ | ||
loader: 'style-loader' | ||
}, | ||
{ | ||
loader: 'css-loader', | ||
}, | ||
{ | ||
loader: 'sass-loader' | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
htmlPlugin, | ||
new webpack.HotModuleReplacementPlugin() | ||
], | ||
devServer: { | ||
contentBase: './dist', | ||
hot: true | ||
} | ||
}; |