Browse Source

Update contributing file

Added Avoiding bundle bloat section
j8
Calinteodor 3 years ago
parent
commit
450c961e68
1 changed files with 17 additions and 0 deletions
  1. 17
    0
      CONTRIBUTING.md

+ 17
- 0
CONTRIBUTING.md View File

@@ -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…
Cancel
Save