DEV Community

Marcin Wosinek
Marcin Wosinek

Posted on • Edited on • Originally published at how-to.dev

1

How to quickly start a webpack project

In this article, I'll show a simple way to start a webpack project with degit

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.

webpack-starter

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.

Usage

$ 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
Enter fullscreen mode Exit fullscreen mode

The resulting application does nothing but says hello in the development console.

Links

Summary

In this article, I have presented a simple project started for the webpack application.

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

While many AI coding tools operate as simple command-response systems, Qodo Gen 1.0 represents the next generation: autonomous, multi-step problem-solving agents that work alongside you.

Read full post →

Top comments (0)

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay