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
1
630
Webpack FTW
Code examples:
https://github.com/k9ordon/webpack-ftw
Klemens Gordon
February 25, 2016
Tweet
Share
More Decks by Klemens Gordon
See All by Klemens Gordon
Yo Building Progressive Framework-less Vanilla Web-applications
k9ordon
0
150
A loosely coupled front-end
k9ordon
2
540
How to hamburger
k9ordon
0
59
Javascript Event Emitter
k9ordon
0
74
responsive view - viennajs 2013-08
k9ordon
0
57
Other Decks in Technology
See All in Technology
隣接領域をBeyondするFinatextのエンジニア組織設計 / beyond-engineering-areas
stajima
1
270
スクラム成熟度セルフチェックツールを作って得た学びとその活用法
coincheck_recruit
1
140
BLADE: An Attempt to Automate Penetration Testing Using Autonomous AI Agents
bbrbbq
0
290
EventHub Startup CTO of the year 2024 ピッチ資料
eventhub
0
110
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
110
信頼性に挑む中で拡張できる・得られる1人のスキルセットとは?
ken5scal
2
520
IBC 2024 動画技術関連レポート / IBC 2024 Report
cyberagentdevelopers
PRO
0
110
Incident Response Practices: Waroom's Features and Future Challenges
rrreeeyyy
0
160
Making your applications cross-environment - OSCG 2024 NA
salaboy
0
180
100 名超が参加した日経グループ横断の競技型 AWS 学習イベント「Nikkei Group AWS GameDay」の紹介/mediajaws202411
nikkei_engineer_recruiting
1
170
Amplify Gen2 Deep Dive / バックエンドの型をいかにしてフロントエンドへ伝えるか #TSKaigi #TSKaigiKansai #AWSAmplifyJP
tacck
PRO
0
370
マルチプロダクトな開発組織で 「開発生産性」に向き合うために試みたこと / Improving Multi-Product Dev Productivity
sugamasao
1
300
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Making Projects Easy
brettharned
115
5.9k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
The Language of Interfaces
destraynor
154
24k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
Being A Developer After 40
akosma
86
590k
How STYLIGHT went responsive
nonsquared
95
5.2k
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?