Commit a09a858
committed
Fix the action logger running in production
The condition guarding the redux-logger middleware tested for the
opposite of what it meant to test, so the logger was installed in
production builds and left out during development. It relied on a
build-time constant that Vite substitutes, so the check folded away
and the middleware ended up unconditional in the shipped bundle.
The check now uses Vite's own environment flags. Test runs are
excluded as well, because Vite reports development mode there too and
the logger would otherwise write into the output of every test that
dispatches an action. This also drops the file's last reference to the
Node process global, and with it an eslint exception.
The redux-logger dependency still reaches the bundle even though
nothing calls it now, because it is CommonJS and tree shaking cannot
remove it. Dropping the dependency is separate work.1 parent 9283212 commit a09a858
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| |||
0 commit comments