Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am timgivois on github.
* I am timgivois (https://keybase.io/timgivois) on keybase.
* I have a public key ASDsBGZgXCXCZZHlxLqKhZGX-q2O0zJtJbrlEDMmsRdDkQo
To claim this, I am signing this object:
@timgivois
timgivois / index.html
Created July 27, 2019 23:43
HTML template for React projects
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>React Example</title>
</head>
<body>
<div id="root"></div>
<script src="/build/bundle.js"></script>
</body>
import React from 'react';
const App = () => (
<div className="container">
<h1>Hello World, React!</h1>
</div>
)
export default App;
@timgivois
timgivois / index.js
Created July 27, 2019 23:44
Basic index js for react applications
import React from 'react'
import ReactDOM from 'react-dom'
import App from './src/App'
ReactDOM.render(<App />, document.getElementById("root"))
@timgivois
timgivois / webpack.config.js
Last active July 28, 2019 00:01
Webpack basic config for projects
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
module.exports = {
entry: './index.js',
output: {
filename: 'bundle.[hash].js',
path: path.resolve(__dirname, 'dist')
},
plugins: [
.container {
align-items: center;
display: flex;
justify-content: center;
padding-top: 10px;
width: 100%;
}
...
{
test:/\.s?css$/,
use:['style-loader','css-loader', 'sass-loader']
}
...
$default-background: #D3D3D3;
body {
height: 100%;
background-color: $default-background;
}
.container {
align-items: center;
display: flex;
...
{
test: /\.(png|svg|jpg|gif)$/,
use: [
'file-loader'
]
}
...
import './App.scss'