Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Webpack Fundamentals
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Cheesecake Labs
August 16, 2018
Programming
56
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
75
How do we create the first impressions?
cheesecakelabs
0
86
Menstrual cup: suit and freedom
cheesecakelabs
0
100
Life is a cycle, better with a bicycle
cheesecakelabs
0
87
Interview Process: how to get the best of people
cheesecakelabs
1
130
My capsule wardrobe experience
cheesecakelabs
3
92
Stonewall Rebellion and its impact on LGBTQIA+ history
cheesecakelabs
1
68
Pregnancy, childbirth and breastfeeding: What do I have to do with it?
cheesecakelabs
0
71
MBTI - Psychological types described by Jung
cheesecakelabs
0
170
Other Decks in Programming
See All in Programming
AIキャラアプリkaiwaの低遅延音声通話基盤をどう作ったか - AWS Gravitonで支える低遅延・低コストAI Agent基盤
mogamit
0
170
Webフレームワークの ベンチマークについて
yusukebe
0
200
Vite+ Unified Toolchain for the Web
naokihaba
0
730
AI がコードを書く時代における新卒エンジニアの仕事風景 (2026) / New Graduate Engineers in the Era of AI Coding (2026)
sushichan044
0
210
Hatena Engineer Seminar #37「言語モデルの活用に関する研究」
slashnephy
0
500
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.8k
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
580
「正の参照」と 「負の導出」で組む ハーネスエンジニアリング
cottpan
1
130
PHPだって関数型したい 〜できること、できないこと〜 / fp-in-php
jsoizo
0
170
信頼性について考えてみる(SRE NEXT 2026 miniLT)
hayama17
0
100
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
260
Dataformのリポジトリを立ち上げるときにまずやること / dataform-day0-2026
snhryt
0
220
Featured
See All Featured
RailsConf 2023
tenderlove
30
1.5k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
AI: The stuff that nobody shows you
jnunemaker
PRO
8
810
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
260
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.6k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
490
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
290
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
870
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
220
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