Parcourir la source

Update contributing file

Added Avoiding bundle bloat section
master
Calinteodor il y a 3 ans
Parent
révision
450c961e68
1 fichiers modifiés avec 17 ajouts et 0 suppressions
  1. 17
    0
      CONTRIBUTING.md

+ 17
- 0
CONTRIBUTING.md Voir le fichier

@@ -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
+```

Chargement…
Annuler
Enregistrer