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
es module bundling with webpack 2
Search
cjies
March 29, 2017
Technology
580
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
390
Other Decks in Technology
See All in Technology
AIエージェントの開発・提供におけるセキュリティリスクの論点と対策
flatt_security
1
480
Azure App Service / Container Apps の組み込み認証
kuniteru
0
170
なぜSRE・セキュリティは評価されないのか?守りの組織を事業成長エンジンに変えた実践
cscengineer
PRO
2
1.9k
Self Healing Rollouts: Automating Production Fixes with Agentic AI
kdubois
0
140
はじめてのDatabricks:技術者向けワークショップ / beginner-workshop
databricksjapan
PRO
0
140
20260906 「AWS運用入門」著者が教える、運用業務への生成AI活用入門
masaruogura
0
200
AIで実装は速くなった。なのにプロダクトは速くならない。職能の壁を越えて価値のフローを設計する
nwiizo
6
6.2k
こんなアーキテクチャ図は嫌だ BEYOND THE TIME: 半年後の自分へ贈る15のメッセージ / 15 of Anti-pattern in AWS Architecture Diagrams
naospon
2
190
Beyond the Hype: Practical AI for Your Oracle Database with MCP
thatjeffsmith
1
210
20260903 Tokyo Jazug Night #62 | Azure エンジニアよ、 その環境は本当にセキュアか?
olivia_0707
1
580
【Oracle AI Spotlight ウェビナー】AWSか、Azureか、Google Cloudか。その議論にオラクルを含める意義。
oracle4engineer
PRO
1
210
本番に近いテストをもっと手軽に - Postmanで広がるAPIテストの世界 / Expanding the World of API Testing with Postman
yokawasa
1
240
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
490
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
45k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
180
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
Mobile First: as difficult as doing things right
swwweet
225
10k
エンジニアに許された特別な時間の終わり
watany
108
250k
How to Talk to Developers About Accessibility
jct
2
530
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
230
Site-Speed That Sticks
csswizardry
13
1.5k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
840
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