Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Tech Stack File

Community Enterprise(/enterprise) Search


(/) (/tech-stack-file)

ome (/categories) / DevOps (/devops) / Build, Test, Deploy (/build-test-deploy) / JS Build Tools / JS Task Runners (/javascript-build-tools)

Webpack vs Yarn

Decisions Pros & Cons Stats Description Jobs 4 Alternatives Integrations Blog Posts

Need advice about which tool to choose?


Get Advice
Ask the StackShare community!

Webpack Yarn
(/webpack) (/yarn)

Follow I use this Follow I use this Add tool

Stacks Followers Votes Stacks Followers Votes


(https://github.com/marketplace/stack-
39.9K 27K 752 23.8K 13.1K 151 file)

Webpack vs Yarn: What are the differences?


Introduction:

In this article, we will explore the key differences between Webpack and Yarn. Both Webpack and Yarn are popular tools in the web See all the technologies you’re
development ecosystem, but they serve different purposes and have distinct features. using across your company.
1. Installation and Package Management Approach: Webpack is primarily a module bundler that helps in managing and
Sign up for
bundling the assets of a web application. It requires the installation of plugins and loaders to work with different types of files (/manage-
and assets. On the other hand, Yarn is a package manager that simplifies the process of managing dependencies and ensures StackShare
companies/enterprise)
consistent installations across different environments. Yarn manages the package.json file and provides commands for Enterprise
installing, updating, and removing dependencies.

2. Build Process and Configuration: Webpack provides a highly configurable build process. It allows developers to define entry Learn More(/enterprise)
points, specify loaders and plugins, and set up optimization strategies. Webpack's rich configuration options enable fine-
grained control over the build process, making it suitable for complex projects. Yarn, on the other hand, does not have a build
process itself. It focuses on package management and relies on other tools like Webpack or Babel for the actual build process.

3. Dependency Resolution and Caching: Yarn uses a deterministic algorithm for package resolution, ensuring that all developers
working on a project have the same dependencies. It creates a yarn.lock file that locks the versions of the packages, thus
providing consistent builds. Webpack, being a module bundler, doesn't handle dependency resolution in the same way as Yarn.
It relies on the package.json file and the installed modules to resolve dependencies at runtime.

4. Concurrent Package Installations: Yarn introduced the concept of "parallel" and "circular" modes in package installations,
which allows faster installation of dependencies. Yarn downloads and installs packages concurrently, leveraging parallel
processing to speed up the process. Webpack, on the other hand, does not handle package installations, so it doesn't have the
Get beautiful automated tech stack docs for
same capability.
your GitHub repos ✨ (/tech-stack-file)
5. Hot Module Replacement (HMR): Webpack has built-in support for Hot Module Replacement, which allows developers to see
Learn about our GitHub App that auto-creates
the changes they make in their code immediately reflected in the browser without a full page refresh. HMR is particularly useful
tech stack docs (YML and Markdown files) that list
during development as it speeds up the iteration process. Yarn, being a package manager, doesn't have native support for
out the full tech stack of a repo, without any
HMR and relies on the module bundler like Webpack to provide this feature.
manual work!
6. Community and Ecosystem: Webpack has a large and active community, with a vibrant ecosystem of plugins, loaders, and
presets.Learn more (/tech-stack-file)
The extensive community support ensures that Webpack can be used for a wide range of projects and scenarios. Yarn,
while popular, is primarily focused on package management and doesn't have the same level of community and ecosystem as
Webpack.
In summary, Webpack is a powerful module bundler with extensive configuration options and HMR support, while Yarn is a package
manager that simplifies dependency management and provides consistent installations across environments. Webpack focuses on
the build process and has a larger community and ecosystem, while Yarn excels at package management and dependency resolution.
Both tools are essential in modern web development workflows, but their roles and features are distinct.

Advice on Webpack and Yarn

StackShare Editors
Apr 23, 2019 | 7 upvotes · 263.5K views (/stackbot/decisions/102623239805976070)

Needs advice on npm(/npm) and Yarn(/yarn)

From a StackShare Community member: “I’m a freelance web developer (I mostly use Node.js ) and for future projects I’m debating
between npm or Yarn as my default package manager. I’m a minimalist so I hate installing software if I don’t need to- in this case
that would be Yarn. For those who made the switch from npm to Yarn, what benefits have you noticed? For those who stuck with
npm, are you happy you with it?"
See more

Replies (14)

(/juliancruzsanchez) Julian Sanchez


Lead Developer at Chore Champion · May 30, 2019 | 11 upvotes · 239.4K views (/juliancruzsanchez/d
ecisions/102183598405625910)

Recommends on Yarn(/yarn) at Chore Champion(/companies/chore-champion)

We use Yarn because it allows us to more simply manage our node_modules. It also simplifies commands and increases
speed when installing modules. Our teams module download time was cut in half after switching from NPM to Yarn. We
now require all employees to use Yarn (to prevent errors with package-lock.json and yarn.lock).

See more

(/Pustelto) Tomáš Pustelník


Apr 23, 2019 | 8 upvotes · 229.6K views (/Pustelto/decisions/101976572231515026)

Recommends on npm(/npm)

I use npm since new version is pretty fast as well (Yarn may be still faster a bit but the difference isn't huge). No need for
other dependency and mainly Yarn sometimes do not work. Sometimes when I want to install project dependencies I got
error using Yarn but with npm everything is installed correctly.

See more

(/zen- zen-li
li) Apr 24, 2019 | 5 upvotes · 226.4K views (/zen-li/decisions/101981514516848693)

Recommends on Yarn(/yarn)

p.s.

I am not sure about the performance of the latest version of npm, whether it is different from my understanding of it
below.Get
Because I useautomated
beautiful npm very rarely whendocs
tech stack I hadfor
the following knowledge.
your GitHub repos
See more ✨ (/tech-stack-file)
Learn about our GitHub App that auto-creates
tech stack docs (YML and Markdown files) that list
out the full tech stack of a repo, without any
(/marknelissen) Mark Nelissen
manual work!
CTO at Gemsotec bvba · Apr 25, 2019 | 5 upvotes · 227.8K views (/marknelissen/decisions/101985706297
Learn more (/tech-stack-file)
519161)
Recommends on npm(/npm) npm(/npm)

I use npm because I also mainly use React and TypeScript . Since several typings (from DefinitelyTyped) depend on the
React typings, Yarn tends to mess up which leads to duplicate libraries present (different versions of the same type
definition), which hinders the Typescript compiler. Npm always resolves to a single version per transitive dependency. At
least that's my experience with both.
See more

(/FerJSsilva) Fernando Silva


Sep 7, 2019 | 4 upvotes · 224.9K views (/FerJSsilva/decisions/102753437112655482)

Recommends on Yarn(/yarn)

As far as I know Yarn is a super module of NPM. But it still needs npm to run.

Yarn was developed by Facebook's guys to fix some npm issues and performance.

If you use the last version of npm most of this problem does not exist anymore.
See more

(/tataata) tataata
Frontend designer and developer · Apr 26, 2019 | 3 upvotes · 224.8K views (/tataata/decisions/1019916494724
57545)

Recommends on Yarn(/yarn)

Yarn made it painless for the team to sync on versions of packages that we use on the project <3

See more

(/shuuji3) Shuuji TAKAHASHI


at shuuji3.xyz · Apr 23, 2019 | 3 upvotes · 225K views (/shuuji3/decisions/101976450283972106)

Recommends on Yarn(/yarn)

I use Yarn because it outputs nice progress messages with cute emoji and installs packages quickly if the package is
cached. Also, Yarn creates yarn.lock file which makes the developer use the consistent environment.

See more

(/MyIsaak) MyIsaak
Apr 23, 2019 | 3 upvotes · 224.8K views (/MyIsaak/decisions/101976405870675588)

Recommends on npm(/npm)

I use npm because its the official package manager for Node. It's reliability, security and speed has increased over time so
the battle is over!

See more

Get beautiful automated tech stack docs for

(/izzur-
your GitHub repos
Izzur Zuhri
✨ (/tech-stack-file)
Learn about our GitHub
Full Stack App that
Developer auto-creates
· Apr 24, 2019 | 3 upvotes · 224.8K views (/izzur-zuhri/decisions/101984626605575198)
zuhri)
tech stack docs (YML and Markdown files) that list
out the full tech stack of a repo, without any
Recommends on npm(/npm)
manual work!

Learn more (/tech-stack-file)


I use npm because it has a lot of community support and the performance difference with alternative tool is not so
significant for me.
See more

(/hagemt) Tor Hagemann


Principal Software Engineer at Socotra · Sep 29, 2021 | 3 upvotes · 125K views (/hagemt/decisions/1070169852
25797219)

Recommends on npm(/npm) Yarn(/yarn)

You should use whichever had the best DX (developer experience) for your team. If you are doing a massive front-end
project, consider yarn if not only because it makes it a snap to go from zero to ready. What some people say about npm
being more stable or easier for smaller projects is highly true as well. (not to mention, you sometimes have to install yarn)
But, note that official NodeJS Docker images ship with both npm and yarn. If you want to use yarn, put package-
See more

(/SlyDen) Denys Slipetskyy


Lead Software Engineer · Apr 24, 2019 | 3 upvotes · 225.5K views (/SlyDen/decisions/101980944144821506)

Recommends on Yarn(/yarn) at EPAM Systems(/companies/epam-systems)

I use Yarn because it process my dependencies way faster, predictable deps resolution order, upgrade-interactive is very
handy + some Yarn specific features (workspaces, Plug’n’Play alternative installation strategy) ...

See more

(/131) Francois Leurent


CWO at IVS · Apr 30, 2019 | 3 upvotes · 225.5K views (/131/decisions/101743960056230311)

Recommends on npm(/npm) at IVS(/companies/ivs)

We tend to stick to npm, yarn is only a fancy alternative, not 10x better. Using a self -hosted private repository (via
sinopia/npm-mirror) make package locking (mostly) pointless.

See more

(/Obapelumi) Obapelumi
Apr 25, 2019 | 3 upvotes · 224.8K views (/Obapelumi/decisions/101987363682470495)

Recommends on Yarn(/yarn)

I am a minimalist too. I once had issues with installing Nuxt.js using NPM so I had to install Yarn but I also found that the
Dev experience was much better

See more

Get beautiful automated tech stack docs for


your GitHub repos ✨ (/tech-stack-file)
Learn about our GitHub App that auto-creates
tech stack docs (YML and Markdown files) that list
out the full tech stack of a repo, without any
manual work!

Learn more (/tech-stack-file)


(/joemewes) Digital All
Mr at 4 All Digital · Apr 23, 2019 | 3 upvotes · 224.8K views (/joemewes/decisions/101976207607809118)

Recommends on npm(/npm)

I use npm because its packaged with node installation and handles npm tokens in CI/CD tools for private
packages/libraries.

See more

Decisions about Webpack and Yarn

Aleksandr Filatov
Contract Software Engineer - Microsoft · Dec 23, 2019 | 4 upvotes · 280.5K views (/greybax/decisions/103358719401282870)

Migrated from JSPM(/jspm) System.js(/system-js) to npm(/npm) Webpack(/webpack) at

Microsoft-365(/companies/microsoft-365) ( My Stack(/greybax/my-stack) )

Why migrated?
I could define the next points why we have to migrate:

Decrease build time of our application. (It was the main cause).
Al j i t ll t k h ti th i t ll
See more

Abigail Watson
Dec 9, 2019 | 2 upvotes · 209.3K views (/awatson1978/decisions/103281735594316984)

Chose rollup(/rollup) over Atmosphere(/atmosphere) Webpack(/webpack) at

Symptomatic, LLC(/companies/symptomatic-llc) ( node-on-fhir(/symptomatic-llc/node-on-fhir) )

We mostly use rollup to publish package onto NPM. For most all other use cases, we use the Meteor build tool (probably 99% of the
time) for publishing packages. If you're using Node on FHIR you probably won't need to know rollup, unless you are somehow
working on helping us publish front end user interface components using FHIR. That being said, we have been migrating away from
Atmosphere package manager towards NPM. As we continue to migrate away, we may publish other NPM packages using rollup.
See more

Oleksandr Fedotov
Senior Software Engineer at joyn · Dec 7, 2019 | 3 upvotes · 265K views (/oleks-fedotov/decisions/103267297466989413)

Chose Yarn(/yarn) over Lerna(/lerna) npm(/npm) at joyn(/companies/joyn) ( smart-tv(/joyn/smart-tv)

As we have to build the application for many different TV platforms we want to split the application logic from the device/platform
specific code. Previously we had different repositories and it was very hard to keep the development process when changes were
done in multiple repositories, as we had to synchronize code reviews as well as merging and then updating the dependencies of
projects. This issues would be even more critical when building the project from scratch what we did at Joyn. Therefor to keep all
See more
Get beautiful automated tech stack docs for
your GitHub repos ✨ (/tech-stack-file)
Learn about our GitHub App that auto-creates
Petr Bambušek
tech stack docs (YML and Markdown files) that list
Head of Frontend
out the at
fullMews · Novof20,
tech stack 2019without
a repo, | 2 upvotes
any · 275.7K views (/pbambusek/decisions/103170189586345499)
manual work!
Chose Yarn
Learn (/yarn)
more over
(/tech-stack-file) npm(/npm) at Mews(/companies/mews) ( Mews(/mews/mews) )
This was no real choice - we switched the moment Yarn was available, and never looked back. Yarn is the only reasonable frontend
package manager that's actually being developed. They even aim to heal the node_modules madness with v2! Npm is just copying
its ideas on top of introducing massive bugs with every change.

See more

Get Advice from developers at your company using


StackShare Enterprise. Sign up for StackShare Enterprise. Learn More(/enterprise)
(/manage-companies/enterprise)

Pros of Webpack Pros of Yarn

Most powerful bundler Incredibly fast


309 85

Built-in dev server with


Easy to use
182 livereload 22

Can handle all types of assets Open Source


142 13

Easy configuration Can install any npm package


87 11

Laravel-mix Works where npm fails


22 8

Sign up to add or upvote pros


Sign up now
Make informed product decisions

Cons of Webpack Cons of Yarn

Hard to configure Facebook


15 16

No clear direction Sends data to facebook


5 7

Spaghetti-Code out of the box Should be installed separately


2 4

SystemJS integration is quite Cannot publish to registry


2 lackluster 3 other than npm

Loader architecture is quite a


2 mess (unreliable/buggy)

Sign up to add or upvote cons


Sign up now
Make informed product decisions

Get beautiful automated tech stack docs for


983your GitHub repos
42.7K ✨ (/tech-stack-file) 667 3
Learn about our GitHub App that auto-creates
tech stack docs (YML and Markdown files) that list
out the full tech stack of a repo, without any
manual work!

Learn more (/tech-stack-file)

(https://github.com/webpack/webpack) (https://github.com/yarnpkg/yarn)
K 8.7K 19y 41.3K 2.7K 19y

What is Webpack? What is Yarn?


A bundler for javascript and friends. Yarn caches every package it downloads
Packs many modules into a few bundled so it never needs to again. It also
assets. Code Splitting allows to load parallelizes operations to maximize
parts for the application on demand. resource utilization so install times are
Through "loaders" modules can be faster than ever.
CommonJs, AMD, ES6 modules, CSS,
Images, JSON, Coffeescript, LESS, ... and
your custom stuff.

Need advice about which tool to choose?


Get Advice
Ask the StackShare community!

Jobs that mention Webpack and Yarn as a desired skillset

(/companies/pinterest) (/companies/pinterest)

Software Engineer, Web Manager II, Engineering - Big Data Query Platform
(https://www.pinterestcareers.com/job-form? (https://www.pinterestcareers.com/job-form?gh_jid=5526839)
gh_jid=5404145) Pinterest (/companies/pinterest)
Pinterest (/companies/pinterest) San Francisco, CA, US; , US
Mexico City, MX; , MX
View
(https://www.pinterestcareers.com/job- View Job (https://www.pinterestcareers.com/job-form?
Job
form?gh_jid=5404145) Details gh_jid=5526839)
Details

+12 +7

(/companies/pinterest) (/companies/postman)

Staff Software Engineer, ML Training Senior Platform Engineer, (Distribution)


(https://www.pinterestcareers.com/job-form? (https://boards.greenhouse.io/postman/jobs/5739819003)
gh_jid=5337871) Postman (/companies/postman)
Pinterest (/companies/pinterest) Bangalore, India
San Francisco, CA, US; , CA, US
View View
(https://www.pinterestcareers.com/job-
Job Job (https://boards.greenhouse.io/postman/jobs/5739819003)
form?gh_jid=5337871)
Details Details

+12 +8

See jobs for Webpack (/jobs/webpack) See jobs for Yarn (/jobs/yarn)

What companies use What companies use Yarn?


Webpack?Get beautiful automated tech stack docs for
your GitHub repos ✨ (/tech-stack-file)
Learn about our GitHub App that auto-creates
tech stack docs (YML and Markdown files) that list
out the full tech stack of a repo, without any
manual work!

Learn more (/tech-stack-file) See which teams inside your


own company are using
Airbnb(/airbnb/airbnb) StackShare(/stackshare/stackshare Webpack or Yarn.

Sign up for
Pinterest(/pinterest/pinterest) Hepsiburada(/hepsiburada/hepsib (/manage-
StackShare
companies/enterprise)
Enterprise
Instagram(/instagram/instagram) DoorDash(/doordash/doordash)

Learn More(/enterprise)
Udemy(/udemy/udemy) Revolut(/revolut/revolut)

Robinhood(/robinhood/robinhood Intuit(/intuit/intuit)

CRED(/cred/cred) trivago(/trivago/trivago)

Sign up to get full access to all the companies


Sign up now
Make informed product decisions

What tools integrate with What tools integrate with


Webpack? Yarn?

JavaScript(/javascript) JavaScript(/javascript)

Font Awesome(/font-awesome) npm(/npm)


npm

Gatsby(/gatsbyjs) phpMyAdmin(/phpmyadmin)

Buddy(/buddy) SvelteKit(/sveltekit)

Gridsome(/gridsome) Dependabot(/dependabot)

Bunyan(/bunyan) Bit(/bit)

Sign up to get full access to all the tool integrations


Sign up now
Make informed product decisions

Blog Posts

Efficient Resource Management at Empowering Pinterest Data Scientists


Pinterest’s Batch Processing ... and Machine Learning Engi...
(/pinterest/efficient-resource- (/pinterest/empowering-pinterest-
management-at-pinterests-batch- data-scientists-and-machine-learning-
processing-platform) engineers-with-pyspark)

+7 6 1420 +11 6 6771

Get beautiful automated tech stack docs for


your GitHub repos ✨ (/tech-stack-file)
Learn about our GitHub App that auto-creates

How Stream Built a Modern RSS


tech stack docs (YML and Markdown files) that list
How Sentry Receives 20 Billion Events
out the full tech stack of a repo, without any
Readermanual
Withwork!
JavaScript (/stream/how- Per Month While Preparin...
stream-built-a-modern-rss-reader-
Learn more (/tech-stack-file) (/sentry/how-sentry-receives-20-
with-javascript)
Jun 18 2018 at 10:02PM
billion-events-per-month-while-
Stream
i t h dl t i th t)
+29 14 13418 +31 28 36770

How Uploadcare Built a Stack That The Stack That Helped Opendoor Buy
Handles 350M File API Reques... and Sell Over $1B in Homes
(/uploadcare/how-uploadcare-built-a- (/opendoor/the-stack-that-helped-
stack-that-handles-350m-file-api- opendoor-buy-and-sell-over-$1b-in-
requests-per-day) homes)

+46 27 32611 +39 22 31500

How LendingHome Scaled Their Scaling Zapier to Automate Billions of


Marketplace To $750M In Real Esta... Tasks (/zapier/scaling-zapier-to-
(/lendinghome/how-lendinghome- automate-billions-of-tasks)
scaled-their-marketplace-to-$750m- Feb 4 2016 at 12:44PM

Zapier
in-real-estate-loans)

+43 18 5235 +42 53 21847

Sign up to see more

What are some alternatives to Webpack and Yarn?

gulp 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 Babel will turn your ES6+ code into ES5 friendly code, so you can start using it right now without waiting for
browser support.

Parcel Parcel is a web application bundler, differentiated by its developer experience. It offers blazing fast
performance utilizing multicore processing, and requires zero configuration.

Browserify Browserify lets you require('modules') in the browser by bundling up all of your dependencies.

Grunt 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—and your team—with basically zero effort.

See all alternatives (/webpack/alternatives)

Get beautiful automated tech stack docs for


your GitHub repos ✨ (/tech-stack-file)
Learn about our GitHub App that auto-creates
tech stack docs (YML and Markdown files) that list
out the full tech stack of a repo, without any
manual work!

RelatedLearn
Comparisons
more (/tech-stack-file) Trending Comparisons
Yarn vs npm (/stackups/npm-vs-yarn) Django vs Laravel vs Node.js (/stackups/django-vs-laravel-vs-nodejs)
Bower vs Yarn vs npm (/stackups/bower- Bootstrap vs Foundation vs Material-UI (/stackups/bootstrap-vs- Top Comparisons
vs-npm-vs-yarn) foundation-vs-material-ui) Bootstrap vs Materialize (/stackups/bootstrap-vs-
Webpack vs Yeoman (/stackups/webpack- Node.js vs Spring Boot (/stackups/nodejs-vs-spring-boot) materialize)
vs-yeoman) Flyway vs Liquibase (/stackups/flyway-vs-liquibase) Bitbucket vs GitHub vs GitLab (/stackups/bitbucket-vs-
Brunch vs Webpack (/stackups/brunch-vs- AWS CodeCommit vs Bitbucket vs GitHub (/stackups/aws- github-vs-gitlab)
webpack) codecommit-vs-bitbucket-vs-github) Postman vs Swagger UI (/stackups/postman-vs-swagger-
Backpack vs Webpack ui)
(/stackups/backpack-vs-webpack) HipChat vs Mattermost vs Slack (/stackups/hipchat-vs-

mattermost-vs-slack)

Tools & Services Company Follow Us (/)


The Tech Stack File (/tech- Blog (/featured-posts) Terms (/terms) · Privacy (/privacy)
(https://twitter.com/stackshareio)
stack-file) Job Search (/jobs)
(https://facebook.com/stackshareio) SOC 2 Type 2 Certified
Compare Tools Careers (/careers)
(/stackups/trending) Our Stack (/stackshare)
Search (/search) Contact Us (https://www.linkedin.com/company/stackshare)

Browse Tool Alternatives (mailto:team@stackshare.io) (https://angel.co/stackshare)


(http://www.aicpa.org/soc4so)
(/alternatives)
Browse Tool Categories Copyright © 2024 StackShare, Inc.
All rights reserved.
(/categories)
Sitemap (/html-
Submit A Tool (/submit)
sitemaps/stackups/main.html)
Approve Tools (/admin/approval-
tool)

Get beautiful automated tech stack docs for


your GitHub repos ✨ (/tech-stack-file)
Learn about our GitHub App that auto-creates
tech stack docs (YML and Markdown files) that list
out the full tech stack of a repo, without any
manual work!

Learn more (/tech-stack-file)

You might also like