+ 1

What is Webpack?

A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows to load parts for the application on demand. Through "loaders" modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.
Webpack is a tool in the JS Build Tools / JS Task Runners category of a tech stack.
Webpack is an open source tool with 58.2K GitHub stars and 7.7K GitHub forks. Here鈥檚 a link to Webpack's open source repository on GitHub

Who uses Webpack?

3671 companies reportedly use Webpack in their tech stacks, including Airbnb, Pinterest, and Instagram.

20431 developers on StackShare have stated that they use Webpack.

Webpack Integrations

JavaScript, Font Awesome, Gatsby, Buddy, and Gridsome are some of the popular tools that integrate with Webpack. Here's a list of all 21 tools that integrate with Webpack.
Pros of Webpack
Most powerful bundler
Built-in dev server with livereload
Can handle all types of assets
Easy configuration
Overengineered, Underdeveloped
Makes it easy to bundle static assets
Better support in Browser Dev-Tools
Decisions about Webpack

Here are some stack decisions, common use cases and reviews by companies and developers who chose Webpack in their tech stack.

I have got a small radio service running on Node.js. Front end is written with React and packed with Webpack . I use Docker for my #DeploymentWorkflow along with Docker Swarm and GitLab CI on a single Google Compute Engine instance, which is also a runner itself. Pretty unscalable decision but it works great for tiny projects. The project is available on https://fridgefm.com

See more
Joshua Dean K眉pper
CEO at Scrayos UG (haftungsbeschr盲nkt) | 6 upvotes 路 68.3K views

For our internal team and collaboration panel we use Nuxt.js (with TypeScript that is transpiled into ES6), Webpack and npm. We enjoy the opinionated nature of Nuxt.js over vanilla Vue.js, as we would end up using all of the components Nuxt.js incorporates anyways and we can adhere to the conventions setup by the Nuxt.js project, which allows us to get better support in case we run into any dead ends. Webpack allows us to create reproducable builds and also debug our application with hot reloads, which greately increased the pace at which we are able to perform and test changes. We also incorporated a lot of testing (ESLint, Chai, Jasmine, Nightwatchjs) into our pipelines and can trigger those jobs through GitLab CI. All packages are fetched through npm, so that we can keep our git repositories slim and are notified of new updates aswell as reported security flaws.

See more

Github Actions has been a breeze to work with. Github Actions offers a nice CI/CD service right inside the Github environment itself. It comes with tight integration with Github. Github Actions workflows are triggered based on a variety of events, such as: commit, pull request, comment...etc.

At Cereo, we serve our Webpack bundle from Amazon S3 and Amazon CloudFront. We're using Github Actions to build bundles, upload them to S3, and invalidate Cloudfront cache. Our codebase is a monorepo with multiple apps. Github Actions lets us check updates using paths so that we can limit executions. Sometimes a pull request still triggers multiple workflows, but we get to run them concurrently with Github Actions. In fact, Github Actions can run up to 20 concurrent jobs.

That being said, don't try to change your entire CI/CD solution in one afternoon. Github Actions is still new to the market. Start small and build your new shiny CI system up.

#CI #ContinuousIntegration #ContinuousDelivery

See more
Simon Reymann
Senior Fullstack Developer at QUANTUSflow Software GmbH | 19 upvotes 路 545.1K views

Our whole Vue.js frontend stack (incl. SSR) consists of the following tools:

  • Nuxt.js consisting of Vue CLI, Vue Router, vuex, Webpack and Sass (Bundler for HTML5, CSS 3), Babel (Transpiler for JavaScript),
  • Vue Styleguidist as our style guide and pool of developed Vue.js components
  • Vuetify as Material Component Framework (for fast app development)
  • TypeScript as programming language
  • Apollo / GraphQL (incl. GraphiQL) for data access layer (https://apollo.vuejs.org/)
  • ESLint, TSLint and Prettier for coding style and code analyzes
  • Jest as testing framework
  • Google Fonts and Font Awesome for typography and icon toolkit
  • NativeScript-Vue for mobile development

The main reason we have chosen Vue.js over React and AngularJS is related to the following artifacts:

  • Empowered HTML. Vue.js has many similar approaches with Angular. This helps to optimize HTML blocks handling with the use of different components.
  • Detailed documentation. Vue.js has very good documentation which can fasten learning curve for developers.
  • Adaptability. It provides a rapid switching period from other frameworks. It has similarities with Angular and React in terms of design and architecture.
  • Awesome integration. Vue.js can be used for both building single-page applications and more difficult web interfaces of apps. Smaller interactive parts can be easily integrated into the existing infrastructure with no negative effect on the entire system.
  • Large scaling. Vue.js can help to develop pretty large reusable templates.
  • Tiny size. Vue.js weights around 20KB keeping its speed and flexibility. It allows reaching much better performance in comparison to other frameworks.
See more
Weverton Timoteo

I find myself struggling trying to use a specific minified CSS file under node_modules for Milligram in Phoenix Framework using Webpack. First I thought that I need to define a resolve entry in my webpack.config.js as described in css-loader docs.

Then, I've discovered that I can simply use this Webpack notation in my manifest file (app.scss):

@import '~milligram/dist/milligram.min';

As described in docs:

To import assets from a node_modules path (include resolve.modules) and for alias, prefix it with a ~

Note that if you have other Webpack loaders, it will expand your CSS file in development mode.

See more

Webpack's Features

  • Bundles ES Modules, CommonJS, and AMD modules (even combined)
  • Can create a single bundle or multiple chunks that are asynchronously loaded at runtime (to reduce initial loading time)
  • Dependencies are resolved during compilation, reducing the runtime size
  • Loaders can preprocess files while compiling, e.g. TypeScript to JavaScript, Handlebars strings to compiled functions, images to Base64, etc
  • Highly modular plugin system to do whatever else your application requires

Webpack Alternatives & Comparisons

What are some alternatives to Webpack?
Build system automating tasks: minification and copying of all JavaScript files, static images. More capable of watching files to automatically rerun the task when a file changes.
Babel will turn your ES6+ code into ES5 friendly code, so you can start using it right now without waiting for browser support.
Parcel is a web application bundler, differentiated by its developer experience. It offers blazing fast performance utilizing multicore processing, and requires zero configuration.
Browserify lets you require('modules') in the browser by bundling up all of your dependencies.
The less work you have to do when performing repetitive tasks like minification, compilation, unit testing, linting, etc, the easier your job becomes. After you've configured it, a task runner can do most of that mundane work for you鈥攁nd your team鈥攚ith basically zero effort.
See all alternatives

Webpack's Followers
17509 developers follow Webpack to keep up with related blogs and decisions.