SlideShare una empresa de Scribd logo
1 de 26
Descargar para leer sin conexión
Webpack - BYOB (build your own bundler)
By Jozef Spišiak
About me
● FMFI UK - Informatics 2011
● 10 years of web development
○ Current: VacuumLabs, BA
○ Pixelant, Malmö, Sweden
○ Monogram Technologies, BA
● TYPO3 CMS, React, Wordpress,
Magento, PHP, JavaScript, HTML,
CSS, MySQL, Bash, Apache, Solr,
Nginx, Jenkins, CircleCI, Docker,
NodeJS, Reddis, Microsoft Azure,
AWS EC2
VacuumLabs
● 70+ developers
● 7 years in business
● Office locations
○ Bratislava
○ London
○ Košice
● Example customers:
○ Prague
○ Brno
Raise your hand if you
have built a website?
Who has written
more than 1000
lines of code in
Javascript?
Which of you have read
about Webpack before?
Let me explain
the problem we
are trying to solve
My first NodeJS program
Let’s check backend
Lets download few modules
Frontend - first problem
First solution:
Here is the culprit!
Alright, other ideas?
● Remove require and run:
find node_modules -name '*.js' | xargs cat >
bundle.js
Unfortunately order matters!
● Manually add them in correct order in
bundle?
grep “function render(“ node_modules -R | wc -l
15
We need to do it smart!
1. Read configuration
2. Build dependency tree
3. Iterate through files and modify the
import and export
4. Write bundle with local scope
Let’s look at the code
What is
Webpack?
Module bundler for web,
mostly used for Javascript
● Organize your code in many
files
● Load your website faster
● Dependency graph
● Asset processing
How do you use it?
Install, configure and run!
Just run: webpack
which writes file:
bundle.js
Conclusion
● Simple example
● Webpack is much more powerful
○ Bundle CSS (Sass/less)
○ Bundle images (base64)
○ Hot reload
○ Chunks
○ Minify, uglify
○ Hot reloading
○ Support of custom plugins
● Easy to start with and great for scaling and deep configuration
Questions?
Contact me
slideshare.net/JozefSpisiak
github.com/jozefspisiak/webpack-demo
jozef.spisiak@vacuumlabs.com
spiso.sk

Más contenido relacionado

La actualidad más candente

Business Apps with the Universal Windows Platform
Business Apps with the Universal Windows PlatformBusiness Apps with the Universal Windows Platform
Business Apps with the Universal Windows PlatformChristian Nagel
 
Last Month in PHP - May 2016
Last Month in PHP - May 2016Last Month in PHP - May 2016
Last Month in PHP - May 2016Eric Poe
 
Talend connect BE Vincent Harcq - Talend ESB - DI
Talend connect BE Vincent Harcq - Talend  ESB - DITalend connect BE Vincent Harcq - Talend  ESB - DI
Talend connect BE Vincent Harcq - Talend ESB - DIVincent Harcq
 
Php training in kolkata
Php training in kolkataPhp training in kolkata
Php training in kolkataSakina Khatun
 
Make It Rain With Web Scraping
Make It Rain With Web ScrapingMake It Rain With Web Scraping
Make It Rain With Web ScrapingGavin Wiener
 
Gutenberg Extended
Gutenberg ExtendedGutenberg Extended
Gutenberg ExtendedSören Wrede
 
NCompass Live: Beyond the CMS: From Darienlibrary.tv to SOPAC3, new technolog...
NCompass Live: Beyond the CMS: From Darienlibrary.tv to SOPAC3, new technolog...NCompass Live: Beyond the CMS: From Darienlibrary.tv to SOPAC3, new technolog...
NCompass Live: Beyond the CMS: From Darienlibrary.tv to SOPAC3, new technolog...Nebraska Library Commission
 
Why and How You Should Move from PHP to Node.js
Why and How You Should Move from PHP to Node.jsWhy and How You Should Move from PHP to Node.js
Why and How You Should Move from PHP to Node.jsBrainhub
 
Web assembly: a brief overview
Web assembly: a brief overviewWeb assembly: a brief overview
Web assembly: a brief overviewPavlo Iatsiuk
 
HTML, Javascript and AJAX
HTML, Javascript and AJAXHTML, Javascript and AJAX
HTML, Javascript and AJAXWan Leung Wong
 
Developing a typo3 template strategy
Developing a typo3 template strategyDeveloping a typo3 template strategy
Developing a typo3 template strategybusynoggin
 
Introjssd 11.8.17
Introjssd 11.8.17Introjssd 11.8.17
Introjssd 11.8.17Thinkful
 
The Evolution Of JavaScript
The Evolution Of JavaScriptThe Evolution Of JavaScript
The Evolution Of JavaScriptMostafa Zaki
 
High Availability for the LAMP Stack
High Availability for the LAMP StackHigh Availability for the LAMP Stack
High Availability for the LAMP StackJason Cannon
 
Introjscb112817
Introjscb112817Introjscb112817
Introjscb112817Thinkful
 

La actualidad más candente (17)

Business Apps with the Universal Windows Platform
Business Apps with the Universal Windows PlatformBusiness Apps with the Universal Windows Platform
Business Apps with the Universal Windows Platform
 
Last Month in PHP - May 2016
Last Month in PHP - May 2016Last Month in PHP - May 2016
Last Month in PHP - May 2016
 
Talend connect BE Vincent Harcq - Talend ESB - DI
Talend connect BE Vincent Harcq - Talend  ESB - DITalend connect BE Vincent Harcq - Talend  ESB - DI
Talend connect BE Vincent Harcq - Talend ESB - DI
 
Php training in kolkata
Php training in kolkataPhp training in kolkata
Php training in kolkata
 
Make It Rain With Web Scraping
Make It Rain With Web ScrapingMake It Rain With Web Scraping
Make It Rain With Web Scraping
 
Gutenberg Extended
Gutenberg ExtendedGutenberg Extended
Gutenberg Extended
 
NCompass Live: Beyond the CMS: From Darienlibrary.tv to SOPAC3, new technolog...
NCompass Live: Beyond the CMS: From Darienlibrary.tv to SOPAC3, new technolog...NCompass Live: Beyond the CMS: From Darienlibrary.tv to SOPAC3, new technolog...
NCompass Live: Beyond the CMS: From Darienlibrary.tv to SOPAC3, new technolog...
 
Why and How You Should Move from PHP to Node.js
Why and How You Should Move from PHP to Node.jsWhy and How You Should Move from PHP to Node.js
Why and How You Should Move from PHP to Node.js
 
Web assembly: a brief overview
Web assembly: a brief overviewWeb assembly: a brief overview
Web assembly: a brief overview
 
HTML, Javascript and AJAX
HTML, Javascript and AJAXHTML, Javascript and AJAX
HTML, Javascript and AJAX
 
Developing a typo3 template strategy
Developing a typo3 template strategyDeveloping a typo3 template strategy
Developing a typo3 template strategy
 
Introjssd 11.8.17
Introjssd 11.8.17Introjssd 11.8.17
Introjssd 11.8.17
 
The Evolution Of JavaScript
The Evolution Of JavaScriptThe Evolution Of JavaScript
The Evolution Of JavaScript
 
High Availability for the LAMP Stack
High Availability for the LAMP StackHigh Availability for the LAMP Stack
High Availability for the LAMP Stack
 
Build web server
Build web serverBuild web server
Build web server
 
Introjscb112817
Introjscb112817Introjscb112817
Introjscb112817
 
What is node.js
What is node.jsWhat is node.js
What is node.js
 

Similar a Webpack

Building an E-commerce website in MEAN stack
Building an E-commerce website in MEAN stackBuilding an E-commerce website in MEAN stack
Building an E-commerce website in MEAN stackdivyapisces
 
Backend Development Bootcamp - Node [Online & Offline] In Bangla
Backend Development Bootcamp - Node [Online & Offline] In BanglaBackend Development Bootcamp - Node [Online & Offline] In Bangla
Backend Development Bootcamp - Node [Online & Offline] In BanglaStack Learner
 
Once upon a time, there were css, js and server-side rendering
Once upon a time, there were css, js and server-side renderingOnce upon a time, there were css, js and server-side rendering
Once upon a time, there were css, js and server-side renderingAndrea Giannantonio
 
JS & NodeJS - An Introduction
JS & NodeJS - An IntroductionJS & NodeJS - An Introduction
JS & NodeJS - An IntroductionNirvanic Labs
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React NativeWaqqas Jabbar
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdflubnayasminsebl
 
Polymer / WebComponents
Polymer / WebComponentsPolymer / WebComponents
Polymer / WebComponentsArnaud Kervern
 
Introduction to react native @ TIC NUST
Introduction to react native @ TIC NUSTIntroduction to react native @ TIC NUST
Introduction to react native @ TIC NUSTWaqqas Jabbar
 
TBP程式新手懶人包
TBP程式新手懶人包TBP程式新手懶人包
TBP程式新手懶人包Bao-Wen Chen
 
Nodejs web service for starters
Nodejs web service for startersNodejs web service for starters
Nodejs web service for startersBruce Li
 
JS digest. Mid-Summer 2017
JS digest. Mid-Summer 2017JS digest. Mid-Summer 2017
JS digest. Mid-Summer 2017ElifTech
 
Glauber Costa on OSv as NoSQL platform
Glauber Costa on OSv as NoSQL platformGlauber Costa on OSv as NoSQL platform
Glauber Costa on OSv as NoSQL platformDon Marti
 
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.jsThe MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.jsMongoDB
 
Create Restful Web Application With Node.js Express Framework
Create Restful Web Application With Node.js Express FrameworkCreate Restful Web Application With Node.js Express Framework
Create Restful Web Application With Node.js Express FrameworkEdureka!
 
LAMP is so yesterday, MEAN is so tomorrow! :)
LAMP is so yesterday, MEAN is so tomorrow! :) LAMP is so yesterday, MEAN is so tomorrow! :)
LAMP is so yesterday, MEAN is so tomorrow! :) Sascha Sambale
 

Similar a Webpack (20)

Building an E-commerce website in MEAN stack
Building an E-commerce website in MEAN stackBuilding an E-commerce website in MEAN stack
Building an E-commerce website in MEAN stack
 
Nodejs overview
Nodejs overviewNodejs overview
Nodejs overview
 
Backend Development Bootcamp - Node [Online & Offline] In Bangla
Backend Development Bootcamp - Node [Online & Offline] In BanglaBackend Development Bootcamp - Node [Online & Offline] In Bangla
Backend Development Bootcamp - Node [Online & Offline] In Bangla
 
Node js projects
Node js projectsNode js projects
Node js projects
 
Node js crash course session 1
Node js crash course   session 1Node js crash course   session 1
Node js crash course session 1
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Once upon a time, there were css, js and server-side rendering
Once upon a time, there were css, js and server-side renderingOnce upon a time, there were css, js and server-side rendering
Once upon a time, there were css, js and server-side rendering
 
JS & NodeJS - An Introduction
JS & NodeJS - An IntroductionJS & NodeJS - An Introduction
JS & NodeJS - An Introduction
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
 
Polymer / WebComponents
Polymer / WebComponentsPolymer / WebComponents
Polymer / WebComponents
 
Introduction to react native @ TIC NUST
Introduction to react native @ TIC NUSTIntroduction to react native @ TIC NUST
Introduction to react native @ TIC NUST
 
TBP程式新手懶人包
TBP程式新手懶人包TBP程式新手懶人包
TBP程式新手懶人包
 
Nodejs web service for starters
Nodejs web service for startersNodejs web service for starters
Nodejs web service for starters
 
JS digest. Mid-Summer 2017
JS digest. Mid-Summer 2017JS digest. Mid-Summer 2017
JS digest. Mid-Summer 2017
 
Glauber Costa on OSv as NoSQL platform
Glauber Costa on OSv as NoSQL platformGlauber Costa on OSv as NoSQL platform
Glauber Costa on OSv as NoSQL platform
 
New paradigms
New paradigmsNew paradigms
New paradigms
 
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.jsThe MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
 
Create Restful Web Application With Node.js Express Framework
Create Restful Web Application With Node.js Express FrameworkCreate Restful Web Application With Node.js Express Framework
Create Restful Web Application With Node.js Express Framework
 
LAMP is so yesterday, MEAN is so tomorrow! :)
LAMP is so yesterday, MEAN is so tomorrow! :) LAMP is so yesterday, MEAN is so tomorrow! :)
LAMP is so yesterday, MEAN is so tomorrow! :)
 

Último

TRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptxTRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptxAndrieCagasanAkio
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书zdzoqco
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predieusebiomeyer
 
Company Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxCompany Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxMario
 
Unidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxUnidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxmibuzondetrabajo
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书rnrncn29
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书rnrncn29
 
ETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptxETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptxNIMMANAGANTI RAMAKRISHNA
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxDyna Gilbert
 
IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119APNIC
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa494f574xmv
 

Último (11)

TRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptxTRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptx
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predi
 
Company Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxCompany Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptx
 
Unidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxUnidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptx
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
 
ETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptxETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptx
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptx
 
IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa
 

Webpack