Last active
March 6, 2018 10:17
-
-
Save whitershade/6ad33c136ee55d2e7fc116453e7c51dd to your computer and use it in GitHub Desktop.
React
This file contains hidden or 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
| 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'] | |
| } | |
| } | |
| ] | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
npm install webpack --save-dev instead of npm install webpack -g