Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Webpack Fundamentals
Search
Cheesecake Labs
August 16, 2018
Programming
58
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Webpack Fundamentals
Beatriz Silveira
Cheesecake Labs
August 16, 2018
More Decks by Cheesecake Labs
See All by Cheesecake Labs
Cats' wellness & care
cheesecakelabs
0
88
How do we create the first impressions?
cheesecakelabs
0
99
Menstrual cup: suit and freedom
cheesecakelabs
0
120
Life is a cycle, better with a bicycle
cheesecakelabs
0
97
Interview Process: how to get the best of people
cheesecakelabs
1
150
My capsule wardrobe experience
cheesecakelabs
3
110
Stonewall Rebellion and its impact on LGBTQIA+ history
cheesecakelabs
1
78
Pregnancy, childbirth and breastfeeding: What do I have to do with it?
cheesecakelabs
0
86
MBTI - Psychological types described by Jung
cheesecakelabs
0
180
Other Decks in Programming
See All in Programming
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
4
3.6k
新卒PdEのリアル
ryu1013
1
510
そのリトライ、死んだコネクションを使い回していませんか ── GoのHTTPクライアントとHTTP/2を実プロダクト障害から学び直す
myus4a
0
220
Java 27新機能 / Java 27 new features
kishida
2
170
巨大モノリシックアプリ モダン化大作戦
ktcryomm
1
1.1k
iOSDC2026登壇資料.pdf
riofujimon
0
180
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
6
2.4k
Agents on Rails - Rails at Scale 2026
irinanazarova
0
200
Jetpack Compose メカニズム
skydoves
0
470
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
3
370
Are APIs Still Relevant in the AI Era?
soyuka
0
300
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
340
Featured
See All Featured
HDC tutorial
michielstock
2
900
For a Future-Friendly Web
brad_frost
183
10k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
710
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
30 Presentation Tips
portentint
PRO
1
400
Unsuck your backbone
ammeep
672
58k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.6k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
360
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Transcript
Webpack Fundamentals
Origins
JS it's just scripts
Inline Script
Problems • Doesn't Scale • Too many Scripts • Performance
Problems • Unmaintainable Scripts • Scope • Size • Readability • Fragility
IIFE's - Immediately Invoked Function Expression
IIFE's • Full rebuilds every time • Lots of IIFE's
are slow
How to import JS on Backend? COMMON JS
CommonJS -> NodeJS
JavaScript Modules CommonJS
JavaScript Modules Was too popular, but how to use this
on Browser Commonjs is synchronous !!! No browser support !!! CommonJS
AMD To transfer module syntax from server usage to browser
usage, CommonJS proposed AMD - Asynchronous Module Definition
AMD But, How can I use it ?
RequireJS • Is a JavaScript module loader. • It helps
load modules asynchronously as needed • You can write AMD style module
RequireJS
Browserify • With Browserify, you can use CommonJS module in
browser application • Traverse the dependency tree of your codes and bundle them up in a single file
Browserify
ES6 Module Syntax • Browsers are not ready for this
new syntax. • There are tools available. These tools allow us to use ES6 module syntax today.
Webpack • Webpack is a module bundler. • If it
is the same as Browserify, why would we need yet another module bundler? • Webpack can handle CommonJS, AMD and ES6 modules.
The Core Concepts • Entry • Output • Loaders •
Plugins
Entry Default ./src/index.js webpack.config.js
Output Default ./dist/main.js
Loaders & Rules test A regular expression that instructs the
compiler which files to run the loader against. use An array/string/function that returns loader objects.
Chaining Loaders less-loader css-loader style-loader style.less style.css *.js Inline style
Plugins Allow you to hook into the entire compilation lifecycle
Add new instance of plugin to plugins key in config object
Using during development 1. Webpack's watch mode 2. webpack-dev-server
Webpack's Watch Mode npm run watch
webpack -dev-server webpack.config.js
webpack -dev-server package.json
Tree Shaking Dead-code elimination
Tree Shaking
Tree Shaking
Production Goal - Improve load time 1. Minified bundles 2.
Lighter weight source maps 3. Optimized assets It's recommend writing separate webpack configurations for each environment