Create a Sample Project


To set up the Webpack, we need to create a sample project.

NOTE: If you already have created a project then you can avoid this article.

We are going to see:

Create a Directory Create a Directory

I’m creating a directory webpack-tutorial within the location c:\xampp\htdocs\tutorials with mkdir CLI command:

mkdir webpack-tutorial


λ mkdir webpack-tutorial

Top ↑

Navigate into the webpack-tutorial directory with command:

cd webpack-tutorial


λ cd webpack-tutorial\

Top ↑

Create package.json Create package.json

Lets create a package.json file with command:

npm init -y


λ npm init -y
Wrote to c:\xampp\htdocs\tutorials\webpack-tutorial\package.json:

  "name": "webpack-tutorial",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  "keywords": [],
  "author": "",
  "license": "ISC"

After executing the above command; we can see the file package.json into the directory webpack-tutorial

Now, we have setup the sample project to use the webpack bundler.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: