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
npm
Search
Denis
October 10, 2019
Programming
0
93
npm
How to build npm
Denis
October 10, 2019
Tweet
Share
More Decks by Denis
See All by Denis
Refactoring
denredsky
0
210
2fast2furios
denredsky
0
98
Other Decks in Programming
See All in Programming
大規模Reactアプリのリアーキテクチャ~8万行のTanStack Query移行の軌跡~
kj455
4
1k
スクラムガイドのスプリントレトロスペクティブを改めて読みかえしてみた / Re-reading the Sprint Retrospective Section in the Scrum Guide
mackey0225
3
480
Fast JSX: Don't clone props object #28768
yossydev
1
180
単体テストを書かない技術 #phpcon_odawara
o0h
PRO
27
8.5k
業務ツールとして使うPostman
msys75
0
100
if constexpr文はテンプレート世界のラムダ式である
faithandbrave
3
670
スキーマ駆動開発による品質とスピードの両立 - 私達は何故、スキーマを書くのか
kentaroutakeda
0
180
雑に思考を整理する技術と効能
konifar
63
30k
Ruby Function Composition
bkuhlmann
1
340
Domain-Driven Transformation
hschwentner
2
1.5k
Introducing Kotlin Multiplatform in an existing mobile app - Workshop Edition | AndroidMakers Paris
prof18
0
150
『Railsオワコン』と言われる時代に、なぜブルーモ証券はRailsを選ぶのか
free_world21
1
360
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
14
1.5k
The Cost Of JavaScript in 2023
addyosmani
20
3.9k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
323
20k
Mobile First: as difficult as doing things right
swwweet
217
8.6k
Agile that works and the tools we love
rasmusluckow
325
20k
Robots, Beer and Maslow
schacon
PRO
155
7.9k
5 minutes of I Can Smell Your CMS
philhawksworth
199
19k
10 Git Anti Patterns You Should be Aware of
lemiorhan
649
58k
Happy Clients
brianwarren
92
6.4k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
20
1.6k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
65
14k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
13
8.3k
Transcript
Как правильно собирать -пакеты в 2к19 году Красновский Денис ДомКлик
2 Красновский Денис Технический руководитель разработки ДомКлик speakerdeck.com/denredsky/npm telegram: @jquery_dlya_slabih
3 Why it’s important? 194.6kB Another one super cool something
for React/Angular/Vue
None
5 developers.google.com/web/tools/lighthouse
6 Performance is about retaining users improving conversions the user
experience people seo hard skills developers.google.com/web/fundamentals/performance/why- performance-matters/
7 «…отсекаю всё лишнее» ― Микеланджело Буонарроти
8 CommonJS AMD UMD ES-modules JS MODULE SYSTEM package.json
9 OR
10 Webpack Initial commit 10 Mar 2012 ~ 3,498,984 repositories
on GitHub Can do all, but ES-modules For example let’s build simple UI-lib
11 Import BAD webpack.prod.js
12 Import GOOD webpack.prod.js
13 Library target webpack.prod.js
14 Dependencies dependencies devDependencies peerDependencies
15 Externals package.json webpack.prod.js WEBPACK-NODE-EXTERNALS OR
16 Gotcha!
17 How to reduce JS via Webpack config I am
super super serious webpack.prod.js
18 ⚠ DANGER ⚠ webpack.js.org/configuration/optimization/#optimizationminimizer webpack.prod.js
19 .browserslistrc Useful for autoprefixer and @babel/preset-env
20 How to reduce CSS via Webpack mini-css-extract-plugin optimize-css-assets-webpack-plugin
21 Transpile JS via Babel 2ality.com/2015/12/babel6-loose-mode.html babel.config.js
22 npm publish package.json
23 Rollup Initial commit 17 May 2015 ~ 221,206 repositories
on GitHub Can build ES-modules For example let’s build simple utils-lib
24 That’s all rollup.config.js
25 ES6 syntax import/export preserveModules: true sideEffects: false Conditions for
tree-shaking
26 Win
27
28 Import cost Display import package size in the editor
29 bundlephobia.com
30 bundlephobia.com
31 Finally duplicate-package-checker-webpack-plugin or inspectpack check bundles weight after build
32 Dynamic import webpack.js.org/guides/code-splitting/
33 Typical situation
34 Blockchain NPM-chain
35 Step 1: we need a shared npm-package for …
36 Step 2: npm-package so cool let’s create more npm
37 Step 3: this was bad idea
speakerdeck.com/denredsky/npm Спасибо за внимание, вопросы? telegram: @jquery_dlya_slabih