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

Similar to Bundle Splitting in Volto (20)

PPTX
Webpack/Parcel: What’s Happening Behind the React App?
PPTX
Introduction to Webpack 5.0 Presentation
PDF
Introduction of webpack 4
PPTX
WEBPACK
PPTX
PPT
PDF
Webpack presentation
PPTX
Improving build solutions dependency management with webpack
PDF
Nuxtjs cheat-sheet
PDF
Installing Webpack with React JS from Scratch.pdf
PPTX
Aleksandr Kutsan "Managing Dependencies in C++"
PPTX
Full Stack_Reac web Development and Application
PDF
How to Webpack your Django!
PDF
Full Stack React Workshop [CSSC x GDSC]
PDF
Create ReactJS Component & publish as npm package
PPTX
What is code splitting in react
PDF
Social Connections VI — IBM Connections Extensions and Themes Demystified
PDF
X tag with web components - joe ssekono
PDF
Reactjs Basics
PDF
sveltekit-en.pdf
Webpack/Parcel: What’s Happening Behind the React App?
Introduction to Webpack 5.0 Presentation
Introduction of webpack 4
WEBPACK
Webpack presentation
Improving build solutions dependency management with webpack
Nuxtjs cheat-sheet
Installing Webpack with React JS from Scratch.pdf
Aleksandr Kutsan "Managing Dependencies in C++"
Full Stack_Reac web Development and Application
How to Webpack your Django!
Full Stack React Workshop [CSSC x GDSC]
Create ReactJS Component & publish as npm package
What is code splitting in react
Social Connections VI — IBM Connections Extensions and Themes Demystified
X tag with web components - joe ssekono
Reactjs Basics
sveltekit-en.pdf
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

Recently uploaded (20)

PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
PDF
Download FL Studio Crack Latest version 2025 ?
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
Computer Software and OS of computer science of grade 11.pptx
PDF
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Website Design Services for Small Businesses.pdf
PPTX
assetexplorer- product-overview - presentation
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PPTX
Monitoring Stack: Grafana, Loki & Promtail
PDF
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Digital Systems & Binary Numbers (comprehensive )
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PPTX
Oracle Fusion HCM Cloud Demo for Beginners
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
AutoCAD Professional Crack 2025 With License Key
CHAPTER 2 - PM Management and IT Context
Navsoft: AI-Powered Business Solutions & Custom Software Development
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
Download FL Studio Crack Latest version 2025 ?
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Computer Software and OS of computer science of grade 11.pptx
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Website Design Services for Small Businesses.pdf
assetexplorer- product-overview - presentation
Advanced SystemCare Ultimate Crack + Portable (2025)
Monitoring Stack: Grafana, Loki & Promtail
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Digital Systems & Binary Numbers (comprehensive )
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
Oracle Fusion HCM Cloud Demo for Beginners
Internet Downloader Manager (IDM) Crack 6.42 Build 41
AutoCAD Professional Crack 2025 With License Key

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