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
es module bundling with webpack 2
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
cjies
March 29, 2017
Technology
600
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
es module bundling with webpack 2
F2E&RGBA Meetup 三月號
cjies
March 29, 2017
More Decks by cjies
See All by cjies
git, let it flow!
cjies
9
2.3k
git flow
cjies
0
430
Other Decks in Technology
See All in Technology
属人化したISMS運用をGitHubとAIで仕組み化した1年間の記録
sioncojp
4
1.9k
MCPでAIが自分で調べに行く
cdataj
0
130
顧客合意を取りながら進めるAWSコスト削減の実践
optim
0
150
Kiro IDE 入門 (画面の各部から、頼み方、任せ方、戻し方まで) | 目指せ Kiro マスター 02
inariku
PRO
4
180
ライフワーク「猫でもわかるDirectConnect」
kentapapa
0
300
Agent Harnessはどう作る?事例から学ぶAI Agentの設計思想
sergicalsix
0
230
並列度を下げたら速くなった — go build の重複コンパイルを実測で見る
tomoaki25
2
1k
「いつか使う」の「いつか」は来ない 〜AI駆動開発における「作らない」判断について〜
ikki0006
0
180
サボる子はいねぇがー!AgentCoreハーネスの脆弱性に学ぶ、エージェントの入力バリデーション
iwamot
PRO
5
320
慶應義塾大学 AI実践05 論文執筆の仕組み化
keio_smilab
PRO
7
3.8k
業務でAWSをあまり使っていない私が、AWSへのモチベを保つ方法
smt7174
0
180
BALLAS Technology Deck
ballas_inc
0
380
Featured
See All Featured
The SEO Collaboration Effect
kristinabergwall1
1
620
Docker and Python
trallard
47
4.3k
How to train your dragon (web standard)
notwaldorf
96
6.9k
Darren the Foodie - Storyboard
khoart
PRO
4
4.1k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
590
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
380
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
1
300
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
460
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.9k
The untapped power of vector embeddings
frankvandijk
2
2k
The SEO identity crisis: Don't let AI make you average
varn
0
630
Transcript
es module bundling with webpack 2 CJ 2017/03/29 F2E&RGBA Meetup
三⽉月號
CJies Tan front end n00b @ iCHEF cjies.com
webpack.js.org
webpack v2 stable released @ Jan 18
migrating to v2 https://webpack.js.org/guides/migrating/
webpack v2 features es6 support tree-shaking dynamic code-splitting build performance
improvement https://medium.com/webpack/webpack-2-and-beyond
es6 support no longer transpile import and export statements with
babel ["es2015", { "modules": false }]
tree-shaking • popularized by Rich Harris’ module bundler Rollup •
“mark” and drop unused exports • won’t work with CommonJS require https://blog.engineyard.com/2016/tree-shaking https://medium.com/@roman01la/dead-code-elimination-and-tree-shaking-in-javascript-build-systems
es ready libraries webpack 2 or rollup will resolve module
first if es6 supported { // commonJS entry "main": "lib/index.js", // es module entry "module": "es/index.js" } https://gist.github.com/cjies/31b602b53adf22320936663756abd61f https://github.com/rollup/rollup/wiki/pkg.module
tree-shaking demo https://github.com/cjies/tree-shaking-demo
issues to follow up webpack/webpack#2867 mishoo/UglifyJS2#1261
dynamic code-splitting
dynamic import() • webpack treats import() as a split-point. •
puts the request module in a separate chunk. • return a Promise.
https://webpack.js.org/guides/code-splitting-import/
react-async-component https://github.com/ctrlplusb/react-async-component
None
limitation of import() path // Wrong, no fully dynamic import(Math.random())
// ( Correct, support partially static import('./components/Product') import('./locale' + language + '.json')
$ exit thanks for your listening