소스 검색

Update contributing file

Added Avoiding bundle bloat section
master
Calinteodor 3 년 전
부모
커밋
450c961e68
1개의 변경된 파일17개의 추가작업 그리고 0개의 파일을 삭제
  1. 17
    0
      CONTRIBUTING.md

+ 17
- 0
CONTRIBUTING.md 파일 보기

@@ -152,3 +152,20 @@ this model but new features should follow this new layout.
152 152
 
153 153
 When working on an old feature, adding the necessary changes to migrate to the new
154 154
 model is encouraged.
155
+
156
+
157
+### Avoiding bundle bloat
158
+
159
+When adding a new feature it's possible that it triggers a build failure due to the increased bundle size. We have safeguards inplace to avoid bundles growing disproportionatelly. While there are legit reasons for increasing the limits, please analyze the bundle first to make sure no unintended dependencies have been included, causing the increase in size.
160
+
161
+First, make a production build with bundle-analysis enabled:
162
+
163
+```
164
+npx webpack -p --analyze-bundle
165
+```
166
+
167
+Then open the interactive bundle analyzer tool:
168
+
169
+```
170
+npx webpack-bundle-analyzer build/app-stats.json
171
+```

Loading…
취소
저장