SlideShare a Scribd company logo
Bundle Splitting in
Volto
Nilesh Gulia
- Developer @Eau De Web
Twitter: @nileshg89
What is Bundle splitting?
Bundle splitting is a way to create separate bundles/chunks for your code when we need them on demand.
This is also known as code splitting. We do have webpack which bundles our code into a single js static
file.
Bundle Splitting in Volto
The Idea?
➔ Manually split code using webpack configuration ( not recommended ).
➔ Using splitChunks plugin. It uses internal rules while spitting chunks and removes duplicated
dependencies.
➔ Dynamic import or lazy-load.
Ways to split bundle
Webpack Prefetch/Preload
Prefetch: fetch the resource available which are needed in future pages/navigation.
Preload: load the resources which are needed in the current page/navigation.
They results in <link/> tag creation in the html file, something like:
<link rel="prefetch/preload" href="chunk-name.js">
Dynamic Import
➔ Import a module on demand. Returns a Promise.
➔ To lazy load modules, React supports React.lazy
➔ React.lazy only to be used with <Suspense> and cannot support SSR
Loadable components to Rescue!
➔ API structure similar to React.lazy
➔ Supports dynamic variables names in import statements.
➔ Support SSR out of the box.
➔ Extract chunks on server and pass it to context of your app with extractManager.
Lets try to lazy load an external lib in
Volto!
Lazy load react-dropzone
Chunk size before:
Plugins
Just add dynamic import:
import loadable from '@loadable/component'
const Moment = loadable(() => import('react-dropzone'))
Loadable returns a dynamic import and when webpack come across this syntax, its start component
splitting...
Bundle Splitting in Volto
Decreased chunk size
Analyse bundle-size:
-> Webpack bundle analyzer:
https://github.com/webpack-contrib/webpack-bundle-analyzer/
-> bundlephobia: https://bundlephobia.com/
-> bundlesize: https://github.com/siddharthkp/bundlesize
Thank you!
Contribute:
Volto: https://github.com/plone/volto/issues

More Related Content

PPTX
002. Working with Webpack
PDF
WordPress development checklist
PPTX
Webpack
PDF
Bundle your modules with Webpack
PPTX
Single Page Application (SPA) using AngularJS
PPTX
Webpack Introduction
PDF
Production optimization with React and Webpack
PDF
Refactoring to a Single Page Application
002. Working with Webpack
WordPress development checklist
Webpack
Bundle your modules with Webpack
Single Page Application (SPA) using AngularJS
Webpack Introduction
Production optimization with React and Webpack
Refactoring to a Single Page Application

What's hot (20)

PPTX
Webpack and Web Performance Optimization
PPTX
Building single page applications
PDF
Structuring web applications with Backbone.js
PPTX
Bundling your front-end with Webpack
PDF
The MEAN stack - SoCalCodeCamp - june 29th 2014
KEY
Features: A better way to package stuff in Drupal
PPT
ColdFusion framework comparison
PPTX
Making Single Page Applications (SPA) faster
PDF
The MEAN Stack
PDF
Intro to Vue
PPTX
Web components, so close!
PDF
Using html5 to build offline applications
PDF
Node js projects
PDF
Html5 storage suggestions for challenges.pptx
PPTX
MEAN stack
PDF
Single page applications
PPTX
Organized web app development using backbone.js
PDF
Setup ColdFusion application using fusebox mvc architecture
PDF
Kickstarting Node.js Projects with Yeoman
PPTX
Single Page Applications on JavaScript and ASP.NET MVC4
Webpack and Web Performance Optimization
Building single page applications
Structuring web applications with Backbone.js
Bundling your front-end with Webpack
The MEAN stack - SoCalCodeCamp - june 29th 2014
Features: A better way to package stuff in Drupal
ColdFusion framework comparison
Making Single Page Applications (SPA) faster
The MEAN Stack
Intro to Vue
Web components, so close!
Using html5 to build offline applications
Node js projects
Html5 storage suggestions for challenges.pptx
MEAN stack
Single page applications
Organized web app development using backbone.js
Setup ColdFusion application using fusebox mvc architecture
Kickstarting Node.js Projects with Yeoman
Single Page Applications on JavaScript and ASP.NET MVC4
Ad

More from PloneFoundation (14)

PDF
Form Block / Formbuilder
PDF
Pyruvate, a reasonably fast, non-blocking, multithreaded WSGI server
PDF
Améliorer la gouvernance et la gestion interne de la ville avec Plone
PDF
Running Plone on AWS
PDF
State of Plone 4 and 5
PDF
State of Plone 2020
PDF
Plone 6 Theming based on Barceloneta LTS
PDF
Modernize Plone's Classic UI
PDF
Green Party Maps
PDF
Volto: A Journey towards Personalization
PDF
Asking questions for the benefit of your future self - Growing with the Plone...
PDF
The State of Pillow
PDF
Pyramid and the Pylons Project in the wild
PDF
Questions
Form Block / Formbuilder
Pyruvate, a reasonably fast, non-blocking, multithreaded WSGI server
Améliorer la gouvernance et la gestion interne de la ville avec Plone
Running Plone on AWS
State of Plone 4 and 5
State of Plone 2020
Plone 6 Theming based on Barceloneta LTS
Modernize Plone's Classic UI
Green Party Maps
Volto: A Journey towards Personalization
Asking questions for the benefit of your future self - Growing with the Plone...
The State of Pillow
Pyramid and the Pylons Project in the wild
Questions
Ad

Recently uploaded (20)

PPTX
assetexplorer- product-overview - presentation
PDF
AutoCAD Professional Crack 2025 With License Key
DOCX
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
L1 - Introduction to python Backend.pptx
PDF
Cost to Outsource Software Development in 2025
PDF
Nekopoi APK 2025 free lastest update
PPTX
history of c programming in notes for students .pptx
PDF
iTop VPN Free 5.6.0.5262 Crack latest version 2025
PDF
medical staffing services at VALiNTRY
PDF
Download FL Studio Crack Latest version 2025 ?
PPTX
Oracle Fusion HCM Cloud Demo for Beginners
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
assetexplorer- product-overview - presentation
AutoCAD Professional Crack 2025 With License Key
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Wondershare Filmora 15 Crack With Activation Key [2025
Advanced SystemCare Ultimate Crack + Portable (2025)
CHAPTER 2 - PM Management and IT Context
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
L1 - Introduction to python Backend.pptx
Cost to Outsource Software Development in 2025
Nekopoi APK 2025 free lastest update
history of c programming in notes for students .pptx
iTop VPN Free 5.6.0.5262 Crack latest version 2025
medical staffing services at VALiNTRY
Download FL Studio Crack Latest version 2025 ?
Oracle Fusion HCM Cloud Demo for Beginners
Reimagine Home Health with the Power of Agentic AI​
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf

Bundle Splitting in Volto

  • 1. Bundle Splitting in Volto Nilesh Gulia - Developer @Eau De Web Twitter: @nileshg89
  • 2. What is Bundle splitting? Bundle splitting is a way to create separate bundles/chunks for your code when we need them on demand. This is also known as code splitting. We do have webpack which bundles our code into a single js static file.
  • 5. ➔ Manually split code using webpack configuration ( not recommended ). ➔ Using splitChunks plugin. It uses internal rules while spitting chunks and removes duplicated dependencies. ➔ Dynamic import or lazy-load. Ways to split bundle
  • 6. Webpack Prefetch/Preload Prefetch: fetch the resource available which are needed in future pages/navigation. Preload: load the resources which are needed in the current page/navigation. They results in <link/> tag creation in the html file, something like: <link rel="prefetch/preload" href="chunk-name.js">
  • 7. Dynamic Import ➔ Import a module on demand. Returns a Promise. ➔ To lazy load modules, React supports React.lazy ➔ React.lazy only to be used with <Suspense> and cannot support SSR
  • 8. Loadable components to Rescue! ➔ API structure similar to React.lazy ➔ Supports dynamic variables names in import statements. ➔ Support SSR out of the box. ➔ Extract chunks on server and pass it to context of your app with extractManager.
  • 9. Lets try to lazy load an external lib in Volto!
  • 12. Just add dynamic import: import loadable from '@loadable/component' const Moment = loadable(() => import('react-dropzone')) Loadable returns a dynamic import and when webpack come across this syntax, its start component splitting...
  • 15. Analyse bundle-size: -> Webpack bundle analyzer: https://github.com/webpack-contrib/webpack-bundle-analyzer/ -> bundlephobia: https://bundlephobia.com/ -> bundlesize: https://github.com/siddharthkp/bundlesize