How to quickly start a webpack project
I'm JS developer with 13 years of professional experience. I'm always happy to teach my craft.
Search for a command to run...
I'm JS developer with 13 years of professional experience. I'm always happy to teach my craft.
No comments yet. Be the first to comment.
I’ve been working in programming for the last 16 years. Let’s see what changes I see in our industry that are enabled by generative AI. Rapid prototyping The last few months, I’ve been working on a set of WordPress plugins, related to event organizat...
Writing unit tests takes time and effort. Nonetheless, many teams insist on writing them anyway—that’s because of the benefits they bring to a project. Those benefits are mainly the following: fast feedback—unit tests speed up each iteration of twea...

Pure functions are the perfect case for unit testing. For a given input, we always expect the same output—there is no internal state involved. Let’s take a look at a few examples and some simple tests that check if the methods work as expected. Jasmi...

Let’s say you have a job interview in a few days. How should you prepare for it so that you can make an informed decision about joining the company, as well as make sure that your interests are taken care of? Prepare your questions An interview is a ...

Creating example projects is a common way of showing your skills to potential employers. Let’s take a look at what’s important to keep in mind when building personal projects with an eye toward impressing prospective employers. Simplicity Building ap...

On this page
In this article, I'll show a simple way to start a webpack project with degit
degit is a tool that lets you take another repository from GitHub and use it to scaffold your project. You can see it being used in serious projects such as SolidJS.
Since I started working on this blog, I created more than 10 repositories with simple applications build with webpack. As I try keeping the code rather minimalistic, in most cases, all the projects end up almost the same. So today, I created a starter project to save me few seconds when starting new demo projects.
$ npx degit how-to-js/webpack-starter
npx: installed 1 in 0.671s
> cloned how-to-js/webpack-starter#HEAD
$ npm install
npm notice created a lockfile as package-lock.json. You should commit this file.
added 121 packages from 158 contributors and audited 121 packages in 3.164s
17 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
$ npm run build
> webpack-starter@1.0.0 build /home/marcin/workspace/github/webpack-starter-demo
> webpack
asset main.js 22 bytes [compared for emit] [minimized] (name: main)
./src/index.js 23 bytes [built] [code generated]
WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value.
Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/
webpack 5.51.1 compiled with 1 warning in 186 ms
The resulting application does nothing but says hello in the development console.
In this article, I have presented a simple project started for the webpack application.