Webpack

  • Webpack Installation:
  1. npm init
  2. npm install react react-dom –save
  3. create an app folder with index.html and index.js
  4. npm install react-router-dom –save
  5. npm install jquery –save
  6. npm install react-router-hash-link –save
  7. npm install babel-core babel-loader babel-preset-env babel-preset-react css-loader style-loader html-webpack-plugin webpack webpack-dev-server –save-dev
  8. npm install node-sass sass-loader –save-dev
  9. create webpack.config.js file
  10. package.json – “scripts”: {“create”: “webpack”}
  11. npm run create
  12. change package.json file: “scripts”: {“start”: “webpack-dev-server –open”}, “babel”: { “presets”: [ “env”, “react”]},
  13. npm run start

Create a new react app

  1. create-react-app folderName
  2. npm install jquery –save
  3. npm install react-router-dom –save
  4. npm install babel-core babel-loader babel-preset-env babel-preset-react css-loader style-loader html-webpack-plugin webpack webpack-dev-server –save-dev
  5. npm run create
  6. npm run start
  • webpack.config.js for Development

react

  • package.json for Production

react

  • webpack.config.js for Production

react

Advertisements

About bernadetteengleman

Hello, I am Bernadette from New York City. I moved here from Chicago in 2013. I am originally from the Philippines. I started studying web programming in 2015. I love it because I like making fun websites and web apps. The projects that I built so far are posted below. I like to cook and I love to travel. I also like to volunteer and I am a team leader with the non-profit organization, NYCares.
This entry was posted in React.js. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s