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
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
360
Other Decks in Technology
See All in Technology
AIプラットフォームを運用し続けるための可観測性
tanimuyk
4
970
AI駆動開発でなんでもハンズオン環境をつくってみた
yoshimi0227
0
190
Oracle Cloud Infrastructure IaaS 新機能アップデート 2026/3 - 2026/5
oracle4engineer
PRO
1
110
long-running-tasks
cipepser
3
460
地元にいないローカルオーガナイザーの立ち回り
uvb_76
1
430
AI-DLCを活用した高品質・安全なAI駆動開発実践 / AI Driven Development
yoshidashingo
1
300
Javaコミュニティをもっと楽しむための9箇条
takasyou
0
990
Chart.js が簡単に使えるようになっていたので OGP 画像生成に使った話
kamekyame
0
120
Gradle×GitHub_ActionsでCI時間を約50%短縮 ジョブ分割の設計と落とし穴 / Cutting CI Time by ~50% with Gradle and GitHub Actions: Job-Splitting Design and Pitfalls
takatty
0
590
AI Engineering Summit Tokyo 2026 AIの前に、やることがある 〜医療データ企業の4フェーズ〜
dtaniwaki
0
500
運用を見据えたAIエージェント設計実践
amacbee
0
1.4k
AI活用を推進するために ファインディが下した、一つの小さな決断
starfish719
0
120
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
300
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Six Lessons from altMBA
skipperchong
29
4.3k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
290
Building the Perfect Custom Keyboard
takai
2
780
The Spectacular Lies of Maps
axbom
PRO
1
780
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
The SEO Collaboration Effect
kristinabergwall1
1
470
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
YesSQL, Process and Tooling at Scale
rocio
174
15k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
70
39k
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