SlideShare a Scribd company logo
When
webpack -p
is not enough
by Maciej Komorowski
Webpack?
Case study
Our star(ng point
Version: webpack 2.2.1
Time: 10805ms
Asset Size Chunks Chunk Names
index.js 322 kB 0 [emitted] [big] index
index.js.gz 98.5 kB [emitted]
Compression Plugin1
import CompressionPlugin from 'compression-webpack-plugin';
const webpackConfig = {
plugins: [
new CompressionPlugin({ ...options })
]
};
1
h$ps://github.com/webpack-contrib/compression-webpack-plugin
Upgrading webpack
from 2.2.1 to 2.3.3
Version: webpack 2.3.3
Time: 9942ms
Asset Size Chunks Chunk Names
index.js 322 kB 0 [emitted] [big] index
index.js.gz 98.4 kB [emitted]
Upgrading dependencies
from package.json
Version: webpack 2.3.3
Time: 11438ms
Asset Size Chunks Chunk Names
index.js 346 kB 0 [emitted] [big] index
index.js.gz 106 kB [emitted]
Enable tree shaking
with ES6 imports2
Version: webpack 2.3.3
Time: 12575ms
Asset Size Chunks Chunk Names
index.js 342 kB 0 [emitted] [big] index
index.js.gz 105 kB [emitted]
First win !
2
h$ps://webpack.js.org/guides/tree-shaking/
Par$al imports
// Standard import:
import { debounce } from 'lodash';
// Partial import:
import debounce from 'lodash/debounce';
Version: webpack 2.3.3
Time: 10241ms
Asset Size Chunks Chunk Names
index.js 278 kB 0 [emitted] [big] index
index.js.gz 82.9 kB [emitted]
Exclude some dependencies
react, react-dom, redux, ...
Version: webpack 2.3.3
Time: 5336ms
Asset Size Chunks Chunk Names
index.js 63.8 kB 0 [emitted] index
index.js.gz 19.9 kB [emitted]
Such wow!
Split your bundle
Gain cache performance
@komomc

More Related Content

PPTX
Kubernetes service with ha
PDF
PDF
JCConf 2016 - Dataflow Workshop Labs
PDF
WKSctl: Gitops Management of Kubernetes Clusters
PDF
Nika it consulting weekly update
PDF
How to manage Kubernetes at scale with just git
PDF
Implementing Progressive Delivery with Your Team (by Leigh Capili)
PPTX
KubeOne
Kubernetes service with ha
JCConf 2016 - Dataflow Workshop Labs
WKSctl: Gitops Management of Kubernetes Clusters
Nika it consulting weekly update
How to manage Kubernetes at scale with just git
Implementing Progressive Delivery with Your Team (by Leigh Capili)
KubeOne

What's hot (19)

PDF
PuppetConf 2017: Zero to Kubernetes -Scott Coulton, Puppet
PDF
PuppetConf 2017: Cloud, Containers, Puppet and You- Carl Caum, Puppet
PDF
Monitoring Kubernetes with Prometheus
PPTX
Make stateful apps in Kubernetes a no brainer with Pure Storage and GitOps
PPTX
FPV Streaming Server with ffmpeg
PDF
Docker Swarm 1.12 Overview and Demo
PDF
KubeCon EU 2016: Using Traffic Control to Test Apps in Kubernetes
PDF
Handling Kubernetes Resources
PDF
Building Docker images with Puppet
PDF
從Google cloud看kubernetes服務
PDF
What is new with JavaScript in Gnome: The 2021 edition
PDF
HackMTY - GitHub Workshop
PDF
2016 08-30 Kubernetes talk for Waterloo DevOps
PDF
Cassandra at Glogster
PDF
Downsampling your data October 2017
PDF
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
PDF
Patroni: Kubernetes-native PostgreSQL companion
PDF
Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...
PDF
Logs/Metrics Gathering With OpenShift EFK Stack
PuppetConf 2017: Zero to Kubernetes -Scott Coulton, Puppet
PuppetConf 2017: Cloud, Containers, Puppet and You- Carl Caum, Puppet
Monitoring Kubernetes with Prometheus
Make stateful apps in Kubernetes a no brainer with Pure Storage and GitOps
FPV Streaming Server with ffmpeg
Docker Swarm 1.12 Overview and Demo
KubeCon EU 2016: Using Traffic Control to Test Apps in Kubernetes
Handling Kubernetes Resources
Building Docker images with Puppet
從Google cloud看kubernetes服務
What is new with JavaScript in Gnome: The 2021 edition
HackMTY - GitHub Workshop
2016 08-30 Kubernetes talk for Waterloo DevOps
Cassandra at Glogster
Downsampling your data October 2017
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
Patroni: Kubernetes-native PostgreSQL companion
Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...
Logs/Metrics Gathering With OpenShift EFK Stack
Ad

Recently uploaded (20)

PDF
Empathic Computing: Creating Shared Understanding
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
A Presentation on Artificial Intelligence
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Machine learning based COVID-19 study performance prediction
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Machine Learning_overview_presentation.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Empathic Computing: Creating Shared Understanding
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Programs and apps: productivity, graphics, security and other tools
A Presentation on Artificial Intelligence
“AI and Expert System Decision Support & Business Intelligence Systems”
Machine learning based COVID-19 study performance prediction
Encapsulation_ Review paper, used for researhc scholars
Machine Learning_overview_presentation.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
sap open course for s4hana steps from ECC to s4
Dropbox Q2 2025 Financial Results & Investor Presentation
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
NewMind AI Weekly Chronicles - August'25-Week II
MIND Revenue Release Quarter 2 2025 Press Release
Chapter 3 Spatial Domain Image Processing.pdf
Approach and Philosophy of On baking technology
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Ad

When webpack -p is not enough

  • 1. When webpack -p is not enough by Maciej Komorowski
  • 3. Case study Our star(ng point Version: webpack 2.2.1 Time: 10805ms Asset Size Chunks Chunk Names index.js 322 kB 0 [emitted] [big] index index.js.gz 98.5 kB [emitted]
  • 4. Compression Plugin1 import CompressionPlugin from 'compression-webpack-plugin'; const webpackConfig = { plugins: [ new CompressionPlugin({ ...options }) ] }; 1 h$ps://github.com/webpack-contrib/compression-webpack-plugin
  • 5. Upgrading webpack from 2.2.1 to 2.3.3 Version: webpack 2.3.3 Time: 9942ms Asset Size Chunks Chunk Names index.js 322 kB 0 [emitted] [big] index index.js.gz 98.4 kB [emitted]
  • 6. Upgrading dependencies from package.json Version: webpack 2.3.3 Time: 11438ms Asset Size Chunks Chunk Names index.js 346 kB 0 [emitted] [big] index index.js.gz 106 kB [emitted]
  • 7. Enable tree shaking with ES6 imports2 Version: webpack 2.3.3 Time: 12575ms Asset Size Chunks Chunk Names index.js 342 kB 0 [emitted] [big] index index.js.gz 105 kB [emitted] First win ! 2 h$ps://webpack.js.org/guides/tree-shaking/
  • 8. Par$al imports // Standard import: import { debounce } from 'lodash'; // Partial import: import debounce from 'lodash/debounce'; Version: webpack 2.3.3 Time: 10241ms Asset Size Chunks Chunk Names index.js 278 kB 0 [emitted] [big] index index.js.gz 82.9 kB [emitted]
  • 9. Exclude some dependencies react, react-dom, redux, ... Version: webpack 2.3.3 Time: 5336ms Asset Size Chunks Chunk Names index.js 63.8 kB 0 [emitted] index index.js.gz 19.9 kB [emitted] Such wow!
  • 10. Split your bundle Gain cache performance