SlideShare a Scribd company logo
1 of 24
Download to read offline
webpack
your final module bundler
whoami
andrea giannantonio
aka
jellybelly
front-end developer at
@jellybellydev
modular javascript
encapsulation
organization
no global scope pollution
different library versions use
security
convenient using
decoupling
re-use
how define module
global variables / namespace / script tag
commonjs
var $ = require('lib/jQuery'),
_ = require('lib/lodash');
//...stuff
module.exports = ...;
amd
define(
'fooModule',
['lib/jQuery', 'lib/lodash'],
function ($, _) {
//...stuff
return { ... }
}
});
require(['lib/jQuery', 'fooModule'],
function ($, foo) {
//...stuff
}
});
amd with commonjs
define(function (require, exports, module) {
var $ = require('lib/jQuery'),
_ = require('lib/lodash');
//...stuff
module.exports = ...;
});
es6
import 'lib/jQuery' as $;
import 'lib/lodash' as _;
//...stuff
export var result = { ... }
webpack
is a module bundler and not a task runner
understands almost any module system: AMD, CommonJS,
ES6 modules, etc
analyzes dependencies among your modules (not only JS
but also CSS, HTML, etc) and generates assets
creates one or many bundles
gives you hooks to transform modules
the flow
or
install
npm install webpack --save-dev
npm install webpack -g
configuration
command line interface
webpack <entry.js> <result.js>
node.js api (great to integrate with grunt, gulp, broccoli, etc)
var webpack = require('webpack');
webpack( { /* configuration */ },
function(err, stats) { /* stuff */ });
file module (touch webpack.config.js)
module.exports = { /* configuration */ };
options
context: base directory for resolving the entry option (it is absolute path)
entry: the entry point of your bundle (can be a string, an array or an object)
output: determines the out folder, file names, etc
module: options affecting normal modules, like which one must be
automatically loaded
resolve: determines how modules are loaded
devtool: enhance debugging (generates map files)
plugins: additional plugins added to the compiler
more...
do you want to know more?
let's go to the code
who uses it
comparison
feature webpack requirejs browserify jspm rollup
commonjs
`require`
yes
only wrapping
in define
yes yes plugin
amd `define` yes yes plugin yes no
amd `require` yes yes no yes no
amd `require`
loads on demand
yes
manual
configuration
no yes no
single bundle yes yes yes yes yes
multiple bundles yes
manual
configuration
manual
configuration
yes no
common bundle
manual
configuration
yes
manual
configuration
no no
watch mode yes no yes no no
webpack 2 is coming
roadmap
native es6 import, export and system.import
tree shaking for es6
config can be a function and –env
simplification resolving options
chunk loading stuff now relies on promise being available
recap
allow commonjs, amd and es6
allow single and multiple entry point
common plugin for shared code between modules
minimize your code
support loader to pre-process files i.e. sass, less, jsx etc.
loaders +150
plugins +30
live reload with webpack-dev-server
friend of your task runner
questions?
thank you
credits
by Андрей Вандакуров
by Antonio Santiago
by Aleksandr Tkalenko
by Alper Ortac
by Daniel Perez
webpack docs
webpack the new rock star of build tools
webpack the not another task runner tool
let’s talk about webpack
webpack the module bundler
webpack is awesome
who uses it by stackshare.io
giphy.com

More Related Content

What's hot

Webpack Tutorial, Uppsala JS
Webpack Tutorial, Uppsala JSWebpack Tutorial, Uppsala JS
Webpack Tutorial, Uppsala JSEmil Öberg
 
Improving build solutions dependency management with webpack
Improving build solutions  dependency management with webpackImproving build solutions  dependency management with webpack
Improving build solutions dependency management with webpackNodeXperts
 
Packing for the Web with Webpack
Packing for the Web with WebpackPacking for the Web with Webpack
Packing for the Web with WebpackThiago Temple
 
Packing it all: JavaScript module bundling from 2000 to now
Packing it all: JavaScript module bundling from 2000 to nowPacking it all: JavaScript module bundling from 2000 to now
Packing it all: JavaScript module bundling from 2000 to nowDerek Willian Stavis
 
Javascript Bundling and modularization
Javascript Bundling and modularizationJavascript Bundling and modularization
Javascript Bundling and modularizationstbaechler
 
Bundling your front-end with Webpack
Bundling your front-end with WebpackBundling your front-end with Webpack
Bundling your front-end with WebpackDanillo Corvalan
 
Bower & Grunt - A practical workflow
Bower & Grunt - A practical workflowBower & Grunt - A practical workflow
Bower & Grunt - A practical workflowRiccardo Coppola
 
System webpack-jspm
System webpack-jspmSystem webpack-jspm
System webpack-jspmJesse Warden
 
DotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + reactDotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + reactChen-Tien Tsai
 
Integrating Browserify with Sprockets
Integrating Browserify with SprocketsIntegrating Browserify with Sprockets
Integrating Browserify with SprocketsSpike Brehm
 
Node.js & Twitter Bootstrap Crash Course
Node.js & Twitter Bootstrap Crash CourseNode.js & Twitter Bootstrap Crash Course
Node.js & Twitter Bootstrap Crash CourseAaron Silverman
 
Bower - A package manager for the web
Bower - A package manager for the webBower - A package manager for the web
Bower - A package manager for the webLarry Nung
 
Advanced front-end automation with npm scripts
Advanced front-end automation with npm scriptsAdvanced front-end automation with npm scripts
Advanced front-end automation with npm scriptsk88hudson
 
Production Ready Javascript With Grunt
Production Ready Javascript With GruntProduction Ready Javascript With Grunt
Production Ready Javascript With GruntXB Software, Ltd.
 
Forget Grunt and Gulp! Webpack and NPM rule them all!
Forget Grunt and Gulp! Webpack and NPM rule them all!Forget Grunt and Gulp! Webpack and NPM rule them all!
Forget Grunt and Gulp! Webpack and NPM rule them all!Derek Willian Stavis
 

What's hot (20)

Webpack Tutorial, Uppsala JS
Webpack Tutorial, Uppsala JSWebpack Tutorial, Uppsala JS
Webpack Tutorial, Uppsala JS
 
Lecture: Webpack 4
Lecture: Webpack 4Lecture: Webpack 4
Lecture: Webpack 4
 
Improving build solutions dependency management with webpack
Improving build solutions  dependency management with webpackImproving build solutions  dependency management with webpack
Improving build solutions dependency management with webpack
 
Packing for the Web with Webpack
Packing for the Web with WebpackPacking for the Web with Webpack
Packing for the Web with Webpack
 
Packing it all: JavaScript module bundling from 2000 to now
Packing it all: JavaScript module bundling from 2000 to nowPacking it all: JavaScript module bundling from 2000 to now
Packing it all: JavaScript module bundling from 2000 to now
 
Webpack
WebpackWebpack
Webpack
 
Javascript Bundling and modularization
Javascript Bundling and modularizationJavascript Bundling and modularization
Javascript Bundling and modularization
 
Angular2 ecosystem
Angular2 ecosystemAngular2 ecosystem
Angular2 ecosystem
 
Bundling your front-end with Webpack
Bundling your front-end with WebpackBundling your front-end with Webpack
Bundling your front-end with Webpack
 
Bower & Grunt - A practical workflow
Bower & Grunt - A practical workflowBower & Grunt - A practical workflow
Bower & Grunt - A practical workflow
 
Grunt and Bower
Grunt and BowerGrunt and Bower
Grunt and Bower
 
System webpack-jspm
System webpack-jspmSystem webpack-jspm
System webpack-jspm
 
Bower power
Bower powerBower power
Bower power
 
DotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + reactDotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + react
 
Integrating Browserify with Sprockets
Integrating Browserify with SprocketsIntegrating Browserify with Sprockets
Integrating Browserify with Sprockets
 
Node.js & Twitter Bootstrap Crash Course
Node.js & Twitter Bootstrap Crash CourseNode.js & Twitter Bootstrap Crash Course
Node.js & Twitter Bootstrap Crash Course
 
Bower - A package manager for the web
Bower - A package manager for the webBower - A package manager for the web
Bower - A package manager for the web
 
Advanced front-end automation with npm scripts
Advanced front-end automation with npm scriptsAdvanced front-end automation with npm scripts
Advanced front-end automation with npm scripts
 
Production Ready Javascript With Grunt
Production Ready Javascript With GruntProduction Ready Javascript With Grunt
Production Ready Javascript With Grunt
 
Forget Grunt and Gulp! Webpack and NPM rule them all!
Forget Grunt and Gulp! Webpack and NPM rule them all!Forget Grunt and Gulp! Webpack and NPM rule them all!
Forget Grunt and Gulp! Webpack and NPM rule them all!
 

Viewers also liked

Warsaw Frontend Meetup #1 - Webpack
Warsaw Frontend Meetup #1 - WebpackWarsaw Frontend Meetup #1 - Webpack
Warsaw Frontend Meetup #1 - WebpackRadosław Rosłaniec
 
Ramda, a functional JavaScript library
Ramda, a functional JavaScript libraryRamda, a functional JavaScript library
Ramda, a functional JavaScript libraryDerek Willian Stavis
 
Webpack Introduction
Webpack IntroductionWebpack Introduction
Webpack IntroductionAnjali Chawla
 
Webpack & React Performance in 16+ Steps
Webpack & React Performance in 16+ StepsWebpack & React Performance in 16+ Steps
Webpack & React Performance in 16+ StepsGrgur Grisogono
 
Webpack and Web Performance Optimization
Webpack and Web Performance OptimizationWebpack and Web Performance Optimization
Webpack and Web Performance OptimizationChen-Tien Tsai
 
PRPL Pattern with Webpack and React
PRPL Pattern with Webpack and ReactPRPL Pattern with Webpack and React
PRPL Pattern with Webpack and ReactGrgur Grisogono
 
Personal and Personalized Learning
Personal and Personalized LearningPersonal and Personalized Learning
Personal and Personalized LearningDean Shareski
 
Zinnov Confluence 2014: Edge of Tomorrow: Fundamental Shifts Shaping Our Future
Zinnov Confluence 2014: Edge of Tomorrow: Fundamental Shifts Shaping Our Future Zinnov Confluence 2014: Edge of Tomorrow: Fundamental Shifts Shaping Our Future
Zinnov Confluence 2014: Edge of Tomorrow: Fundamental Shifts Shaping Our Future Aricent
 
WordCamp Sydney 2016 - Day 2 Closing Remarks
WordCamp Sydney 2016 - Day 2 Closing RemarksWordCamp Sydney 2016 - Day 2 Closing Remarks
WordCamp Sydney 2016 - Day 2 Closing RemarksWordCamp Sydney
 
Proyeksi vektor aji santoso ( 31 ) msp
Proyeksi vektor aji santoso ( 31 ) mspProyeksi vektor aji santoso ( 31 ) msp
Proyeksi vektor aji santoso ( 31 ) msplaurisahat07
 
ドイツ大使館向け「事業認証申請書」
ドイツ大使館向け「事業認証申請書」ドイツ大使館向け「事業認証申請書」
ドイツ大使館向け「事業認証申請書」Naoki Miyano
 
How to develop a mobile app for events and conferences with little to no reso...
How to develop a mobile app for events and conferences with little to no reso...How to develop a mobile app for events and conferences with little to no reso...
How to develop a mobile app for events and conferences with little to no reso...Matthew Shoup
 
Customer service careers
Customer service careersCustomer service careers
Customer service careerscrew
 
Becoming current spring_14
Becoming current spring_14Becoming current spring_14
Becoming current spring_14countrygirl3
 
That's So Fake: Exploring Critical Literacy
That's So Fake: Exploring Critical LiteracyThat's So Fake: Exploring Critical Literacy
That's So Fake: Exploring Critical LiteracyDean Shareski
 

Viewers also liked (19)

Warsaw Frontend Meetup #1 - Webpack
Warsaw Frontend Meetup #1 - WebpackWarsaw Frontend Meetup #1 - Webpack
Warsaw Frontend Meetup #1 - Webpack
 
Ramda, a functional JavaScript library
Ramda, a functional JavaScript libraryRamda, a functional JavaScript library
Ramda, a functional JavaScript library
 
Webpack Introduction
Webpack IntroductionWebpack Introduction
Webpack Introduction
 
Webpack & React Performance in 16+ Steps
Webpack & React Performance in 16+ StepsWebpack & React Performance in 16+ Steps
Webpack & React Performance in 16+ Steps
 
Webpack and Web Performance Optimization
Webpack and Web Performance OptimizationWebpack and Web Performance Optimization
Webpack and Web Performance Optimization
 
PRPL Pattern with Webpack and React
PRPL Pattern with Webpack and ReactPRPL Pattern with Webpack and React
PRPL Pattern with Webpack and React
 
Personal and Personalized Learning
Personal and Personalized LearningPersonal and Personalized Learning
Personal and Personalized Learning
 
Zinnov Confluence 2014: Edge of Tomorrow: Fundamental Shifts Shaping Our Future
Zinnov Confluence 2014: Edge of Tomorrow: Fundamental Shifts Shaping Our Future Zinnov Confluence 2014: Edge of Tomorrow: Fundamental Shifts Shaping Our Future
Zinnov Confluence 2014: Edge of Tomorrow: Fundamental Shifts Shaping Our Future
 
WordCamp Sydney 2016 - Day 2 Closing Remarks
WordCamp Sydney 2016 - Day 2 Closing RemarksWordCamp Sydney 2016 - Day 2 Closing Remarks
WordCamp Sydney 2016 - Day 2 Closing Remarks
 
Proyeksi vektor aji santoso ( 31 ) msp
Proyeksi vektor aji santoso ( 31 ) mspProyeksi vektor aji santoso ( 31 ) msp
Proyeksi vektor aji santoso ( 31 ) msp
 
ドイツ大使館向け「事業認証申請書」
ドイツ大使館向け「事業認証申請書」ドイツ大使館向け「事業認証申請書」
ドイツ大使館向け「事業認証申請書」
 
How to develop a mobile app for events and conferences with little to no reso...
How to develop a mobile app for events and conferences with little to no reso...How to develop a mobile app for events and conferences with little to no reso...
How to develop a mobile app for events and conferences with little to no reso...
 
Steve job (arouba)
Steve job (arouba)Steve job (arouba)
Steve job (arouba)
 
Customer service careers
Customer service careersCustomer service careers
Customer service careers
 
Becoming current spring_14
Becoming current spring_14Becoming current spring_14
Becoming current spring_14
 
That's So Fake: Exploring Critical Literacy
That's So Fake: Exploring Critical LiteracyThat's So Fake: Exploring Critical Literacy
That's So Fake: Exploring Critical Literacy
 
From desires, obligations and norms to goals
From desires, obligations and norms to goalsFrom desires, obligations and norms to goals
From desires, obligations and norms to goals
 
Guía sec
Guía secGuía sec
Guía sec
 
Junho jardim
Junho jardimJunho jardim
Junho jardim
 

Similar to Webpack: your final module bundler

Modules and EmbedJS
Modules and EmbedJSModules and EmbedJS
Modules and EmbedJSJens Arps
 
Angular JS in 2017
Angular JS in 2017Angular JS in 2017
Angular JS in 2017Ayush Sharma
 
Advanced Node.JS Meetup
Advanced Node.JS MeetupAdvanced Node.JS Meetup
Advanced Node.JS MeetupLINAGORA
 
JavaScript Modules Done Right
JavaScript Modules Done RightJavaScript Modules Done Right
JavaScript Modules Done RightMariusz Nowak
 
uRequire@greecejs: An introduction to http://uRequire.org
uRequire@greecejs: An introduction to http://uRequire.orguRequire@greecejs: An introduction to http://uRequire.org
uRequire@greecejs: An introduction to http://uRequire.orgAgelos Pikoulas
 
Rails Engine | Modular application
Rails Engine | Modular applicationRails Engine | Modular application
Rails Engine | Modular applicationmirrec
 
Frontend JS workflow - Gulp 4 and the like
Frontend JS workflow - Gulp 4 and the likeFrontend JS workflow - Gulp 4 and the like
Frontend JS workflow - Gulp 4 and the likeDamien Seguin
 
Beyond DOMReady: Ultra High-Performance Javascript
Beyond DOMReady: Ultra High-Performance JavascriptBeyond DOMReady: Ultra High-Performance Javascript
Beyond DOMReady: Ultra High-Performance Javascriptaglemann
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller ColumnsJonathan Fine
 
Intro To Node.js
Intro To Node.jsIntro To Node.js
Intro To Node.jsChris Cowan
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
 
20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdevFrank Rousseau
 
Datagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and BackgridDatagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and BackgridGiorgio Cefaro
 
Datagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and BackgridDatagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and Backgrideugenio pombi
 
Writing your Third Plugin
Writing your Third PluginWriting your Third Plugin
Writing your Third PluginJustin Ryan
 
Code Splitting in Practice - Shanghai JS Meetup May 2016
Code Splitting in Practice - Shanghai JS Meetup May 2016Code Splitting in Practice - Shanghai JS Meetup May 2016
Code Splitting in Practice - Shanghai JS Meetup May 2016Wiredcraft
 

Similar to Webpack: your final module bundler (20)

Modules and EmbedJS
Modules and EmbedJSModules and EmbedJS
Modules and EmbedJS
 
IOC + Javascript
IOC + JavascriptIOC + Javascript
IOC + Javascript
 
Browserify
BrowserifyBrowserify
Browserify
 
Angular JS in 2017
Angular JS in 2017Angular JS in 2017
Angular JS in 2017
 
Advanced Node.JS Meetup
Advanced Node.JS MeetupAdvanced Node.JS Meetup
Advanced Node.JS Meetup
 
JavaScript Modules Done Right
JavaScript Modules Done RightJavaScript Modules Done Right
JavaScript Modules Done Right
 
RequireJS
RequireJSRequireJS
RequireJS
 
uRequire@greecejs: An introduction to http://uRequire.org
uRequire@greecejs: An introduction to http://uRequire.orguRequire@greecejs: An introduction to http://uRequire.org
uRequire@greecejs: An introduction to http://uRequire.org
 
Rails Engine | Modular application
Rails Engine | Modular applicationRails Engine | Modular application
Rails Engine | Modular application
 
Frontend JS workflow - Gulp 4 and the like
Frontend JS workflow - Gulp 4 and the likeFrontend JS workflow - Gulp 4 and the like
Frontend JS workflow - Gulp 4 and the like
 
Beyond DOMReady: Ultra High-Performance Javascript
Beyond DOMReady: Ultra High-Performance JavascriptBeyond DOMReady: Ultra High-Performance Javascript
Beyond DOMReady: Ultra High-Performance Javascript
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller Columns
 
Intro To Node.js
Intro To Node.jsIntro To Node.js
Intro To Node.js
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
JavaScript Module Loaders
JavaScript Module LoadersJavaScript Module Loaders
JavaScript Module Loaders
 
20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev
 
Datagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and BackgridDatagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and Backgrid
 
Datagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and BackgridDatagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and Backgrid
 
Writing your Third Plugin
Writing your Third PluginWriting your Third Plugin
Writing your Third Plugin
 
Code Splitting in Practice - Shanghai JS Meetup May 2016
Code Splitting in Practice - Shanghai JS Meetup May 2016Code Splitting in Practice - Shanghai JS Meetup May 2016
Code Splitting in Practice - Shanghai JS Meetup May 2016
 

Recently uploaded

Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptrcbcrtm
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 

Recently uploaded (20)

Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.ppt
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Odoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting ServiceOdoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting Service
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 

Webpack: your final module bundler

  • 3. modular javascript encapsulation organization no global scope pollution different library versions use security convenient using decoupling re-use
  • 5. global variables / namespace / script tag
  • 6. commonjs var $ = require('lib/jQuery'), _ = require('lib/lodash'); //...stuff module.exports = ...;
  • 7. amd define( 'fooModule', ['lib/jQuery', 'lib/lodash'], function ($, _) { //...stuff return { ... } } }); require(['lib/jQuery', 'fooModule'], function ($, foo) { //...stuff } });
  • 8. amd with commonjs define(function (require, exports, module) { var $ = require('lib/jQuery'), _ = require('lib/lodash'); //...stuff module.exports = ...; });
  • 9. es6 import 'lib/jQuery' as $; import 'lib/lodash' as _; //...stuff export var result = { ... }
  • 10. webpack is a module bundler and not a task runner understands almost any module system: AMD, CommonJS, ES6 modules, etc analyzes dependencies among your modules (not only JS but also CSS, HTML, etc) and generates assets creates one or many bundles gives you hooks to transform modules
  • 12. or install npm install webpack --save-dev npm install webpack -g
  • 13. configuration command line interface webpack <entry.js> <result.js> node.js api (great to integrate with grunt, gulp, broccoli, etc) var webpack = require('webpack'); webpack( { /* configuration */ }, function(err, stats) { /* stuff */ }); file module (touch webpack.config.js) module.exports = { /* configuration */ };
  • 14. options context: base directory for resolving the entry option (it is absolute path) entry: the entry point of your bundle (can be a string, an array or an object) output: determines the out folder, file names, etc module: options affecting normal modules, like which one must be automatically loaded resolve: determines how modules are loaded devtool: enhance debugging (generates map files) plugins: additional plugins added to the compiler more...
  • 15. do you want to know more?
  • 16. let's go to the code
  • 18. comparison feature webpack requirejs browserify jspm rollup commonjs `require` yes only wrapping in define yes yes plugin amd `define` yes yes plugin yes no amd `require` yes yes no yes no amd `require` loads on demand yes manual configuration no yes no single bundle yes yes yes yes yes multiple bundles yes manual configuration manual configuration yes no common bundle manual configuration yes manual configuration no no watch mode yes no yes no no
  • 19. webpack 2 is coming
  • 20. roadmap native es6 import, export and system.import tree shaking for es6 config can be a function and –env simplification resolving options chunk loading stuff now relies on promise being available
  • 21. recap allow commonjs, amd and es6 allow single and multiple entry point common plugin for shared code between modules minimize your code support loader to pre-process files i.e. sass, less, jsx etc. loaders +150 plugins +30 live reload with webpack-dev-server friend of your task runner
  • 24. credits by Андрей Вандакуров by Antonio Santiago by Aleksandr Tkalenko by Alper Ortac by Daniel Perez webpack docs webpack the new rock star of build tools webpack the not another task runner tool let’s talk about webpack webpack the module bundler webpack is awesome who uses it by stackshare.io giphy.com