Reader small image

You're reading from  Hands-on JavaScript for Python Developers

Product typeBook
Published inSep 2020
Reading LevelIntermediate
PublisherPackt
ISBN-139781838648121
Edition1st Edition
Tools
Right arrow
Author (1)
Sonyl Nagale
Sonyl Nagale
author image
Sonyl Nagale

Chicago-born, Iowa-raised, Los Angeles-seasoned, and now New York City-flavored, Sonyl Nagale started his career as a graphic designer focusing on web, which led down the slippery slope to becoming a full-stack technologist instead. With an eye toward the client use case and conversation with the creative side, he prides himself on taking a holistic approach to software engineering. Having worked at start-ups and global media companies using a variety of languages and frameworks, he likes solving new and novel challenges. Passionate about education, he's always excited to have great teachable moments complete with laughter and seeing the Aha! moments in students eyes.
Read more about Sonyl Nagale

Right arrow

Using webpack

Now, webpack is one of many modular tools that can be used in your program. Additionally, unlike React scripts, it has use outside of React: it can be used as a bundler for many different types of applications. To get our hands dirty, let's create a small, useless sample project:

  1. Create a new directory and navigate into it: mkdir webpack-example ; cd webpack-example.
  2. We'll be using NPM, so we need to initialize it. We'll also accept the defaults: npm init -y.
  3. We have to then install webpack: npm install webpack webpack-cli --save-dev.

Note that we're using --save-dev here because we don't need webpack to be built into our production-level files. By using dev dependencies, we can help reduce our bundle size, a factor that can slow down applications if it bloats.

If you look in the node_modules directory here, you'll see that we've already installed over 3.5 thousand files from our dependencies. Our project is fairly boring as it...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Hands-on JavaScript for Python Developers
Published in: Sep 2020Publisher: PacktISBN-13: 9781838648121

Author (1)

author image
Sonyl Nagale

Chicago-born, Iowa-raised, Los Angeles-seasoned, and now New York City-flavored, Sonyl Nagale started his career as a graphic designer focusing on web, which led down the slippery slope to becoming a full-stack technologist instead. With an eye toward the client use case and conversation with the creative side, he prides himself on taking a holistic approach to software engineering. Having worked at start-ups and global media companies using a variety of languages and frameworks, he likes solving new and novel challenges. Passionate about education, he's always excited to have great teachable moments complete with laughter and seeing the Aha! moments in students eyes.
Read more about Sonyl Nagale