Setup and Installation

Bharat Tiwari
A beginner’s guide to Webpack 2
2 min readMay 6, 2017

Basic folder structure setup

Lets start by creating an empty project folder and initialize it for npm using npm init command

  1. On the terminal /command prompt, cd to the folder where you want to create your project folder.
  2. Create a folder learn-webpack2 using mkdir command and cd to this new folder.

3. Initialize it for npm using npm init command, and answer the questions the command prompts for. In the end, the command will show you the contents of package.json its going to create for you in the folder and ask you to confirm, press enter / yes to confirm.

4. Open the folder in a web editor of your choice. I am using Visual studio code. You should see package.json created by the above command in the folder.

5. We will create the bare minimum folders and files, as below, for us to get started with a javascript application.

6. Add the below code to app.js

--

--