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 FTW
Search
Klemens Gordon
February 25, 2016
Technology
690
1
Share
Webpack FTW
Code examples:
https://github.com/k9ordon/webpack-ftw
Klemens Gordon
February 25, 2016
More Decks by Klemens Gordon
See All by Klemens Gordon
Yo Building Progressive Framework-less Vanilla Web-applications
k9ordon
0
170
A loosely coupled front-end
k9ordon
2
630
How to hamburger
k9ordon
0
69
Javascript Event Emitter
k9ordon
0
81
responsive view - viennajs 2013-08
k9ordon
0
72
Other Decks in Technology
See All in Technology
OpenClaw初心者向けセミナー / OpenClaw Beginner Seminar
cmhiranofumio
0
360
AI前提とはどういうことか
daisuketakeda
0
150
AIペネトレーションテスト・ セキュリティ検証「AgenticSec」ご紹介資料
laysakura
0
1.6k
建設的な現実逃避のしかた / How to practice constructive escapism
pauli
4
290
自己組織化を試される緑茶ハイを求めて、今日も全力であそんで学ぼう / Self-Organization and Shochu Green Tea
naitosatoshi
0
290
チームで育てるAI自走環境_20260409
fuktig
0
940
OCI技術資料 : 証明書サービス概要
ocise
1
7.2k
「できない」のアウトプット 同人誌『精神を壊してからの』シリーズ出版を 通して得られたこと
comi190327
3
630
スクラムを支える内部品質の話
iij_pr
0
320
ふりかえりを 「あそび」にしたら、 学習が勝手に進んだ / Playful Retros Drive Learning
katoaz
0
400
AIがコードを書く時代の ジェネレーティブプログラミング
polidog
PRO
3
620
OCI技術資料 : ロード・バランサ 概要 - FLB・NLB共通
ocise
4
28k
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
390
Music & Morning Musume
bryan
47
7.1k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
870
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
Are puppies a ranking factor?
jonoalderson
1
3.2k
Deep Space Network (abreviated)
tonyrice
0
110
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
160
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
68
38k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.8k
Transcript
SHIPPING A FRONTEND
KLEMENS GORDON Frontend Developer karriere.at likes .JS and STUFF @thisisgordon
IRL
bundling, precompiling, transforming, factor out, extract text, code splitting, commons
chunks, post-loaders, wtf, yadda yadda yadda … to send css and js files to our friend browser.
WTf
OUR FRIEND BROWSER LIKES JS AND CSS AND ASSETS AND
STUFF
“FRONT-END OPS” 1. history of shipping frontend at karriere.at 2.
webpack examples
Browser eats Programmer programms
timetravel ...
once upon a time … ~2005 v1 - ~ 1
developer - windows xp was the hottest shit - there was no iphone - cleartype was opt in - internetexplorer ...
karriere.at v1 - 2005 shipping source files
script2.js styles.css Browser script2.js styles.css Programmer script1.js script1.js
why its bad to ship js and css as sourcefiles:
(a mvp list) - performance (requests, big files) - code gets messy - ……..............................
timetravel ...
later … ~2009 v2 - more developer (2-3) - rise
of the jquery - gui is getting more complexe (autocompletes, ajax ftw, yadda) => more frontend code
None
autocomplete.js styles.css Browser autocomplete.jquery.js styles.css Programmer jquery.js page1.js page2.js autocomplete.jquery.js
styles.css page1.min.js jquery.js load me first load me on page 2 before jquery load me on page1 load me on page2 load me everywhere compress page2.min.js
- load order - dependencies - post processing
more timetraveling
v3 … ~2013 - ~ 5 devs - even more
client app stuff - responsive - amd patterns (with curljs) - grunt.js - concat all the things - less
- @unscriptable John Hann “Introducing RaveJS”
Browser page1.less Programmer page1.js page2.css page2.js autocomplete.less autocomplete.js a/_partial.js a/_partial.css
b/_partial.js bundled: amd: page2.js page2.less autocomplete.cs autocomplete.js b/_partial.js a/_partial.less a/_partial.js core.js vendor/polyfill page1.css page1.js common.css common.js
AMD DEPENDENCIES
POST PROCESS HANDCRAFTED BUNDLES ARRAY & SINGLE MODULES
GOES OUT
- module has dependencies -> load order - browser gets
small entry files - more shared code BUT - manual concat is a pain (amd fallback) - .less and .js has separate dependency trees
v4 ~2016
None
None
None
None
1. bundle 2. the css thing 3. loaders 4. code
splitting
Installation npm install webpack -g npm install webpack-dev-server -g
module-b.js 1 Simple Bundle bundle.js contains everything module-a.js requires module
b entry.js requires module a
2 the css thing entry.js bundle.js contains everything npm i
css-loader style-loader -D entry.css module-b.css module-b.js module-a.css module-a.js
3 loaders entry.es6.js bundle.js contains everything npm i babel-loader babel-core
babel-preset-es2015 -D entry.css module-b.css module-b.es6.js module-a.css module-a.es6.js hyperlink
4 code splitting entry1.js bundle1.js npm install extract-text-webpack-plugin -D module-a.js
entry2.js module-b.js bundle2.js commons.js
more stuff: - analyse - https://webpack.github. io/analyse/ - dev server
hot module replacement - https://webpack.github.io/docs/hot- module-replacement.html - production builds
one more timetraveling
~2016 HTTP2 SHIPPING SOURCE FILES LIKE ITS 2005
None
questions?