You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,34 @@
47
47
//...
48
48
```
49
49
50
+
## Problematic Settings
51
+
52
+
> **Warning** <br />
53
+
> Use at your own discretion
54
+
55
+
### dont use `browser` field
56
+
57
+
webpack's resolve module algorithm picks a more specific field from `package.json` (and other bundlers too), so webpack chooses UMD module from `browser` field on the default and that breaks tree-shaking[^1]
<img width="1506" alt="Снимок экрана 2022-08-05 в 11 12 48" src="https://user-images.githubusercontent.com/6726016/183033639-20b33c71-5c81-442c-a711-baa3b266f0dc.png">
66
+
67
+
</details>
68
+
69
+
70
+
### dont use `preserveModules`
71
+
72
+
CJS build contains `preserveModules` enabled and that creates bundle problems
73
+
- all external modules are copied to the `dist` folder and shipped to `npm`, so all users download them twice
74
+
75
+
- Useing a browser field and `preserveModules` don't copy files specified by this field, so it creates issues like https://github.com/TanStack/query/issues/3965
0 commit comments