Skip to content

Instantly share code, notes, and snippets.

@whitershade
Last active March 6, 2018 10:17
Show Gist options
  • Select an option

  • Save whitershade/6ad33c136ee55d2e7fc116453e7c51dd to your computer and use it in GitHub Desktop.

Select an option

Save whitershade/6ad33c136ee55d2e7fc116453e7c51dd to your computer and use it in GitHub Desktop.
React
npm init
npm install webpack -g
npm install --save react react-dom react-router
npm install --save-dev babel-core babel-loader babel-preset-es2015 babel-preset-react
mkdir public
mkdir app
cd app
mkdir components
touch index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>React Github Notetaker</title>
<link rel="stylesheet" href="../bower_components/bootstrap/dist/css/bootstrap.min.css">
</head>
<body>
<div id="app"></div>
<script src="bundle.js"></script>
</body>
</html>
webpack.config.js
module.exports = {
entry: "./app/components/Main.js",
output: {
filename: "public/bundle.js"
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel',
query: {
presets: ['es2015', 'react']
}
}
]
}
};
@kasiriveni
Copy link

npm install webpack --save-dev instead of npm install webpack -g

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment