Skip to content

Commit 6966530

Browse files
committed
Better redux devtooling support
1 parent ef5d0fb commit 6966530

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
"postcss-preset-env": "^6.7.0",
9292
"precss": "^4.0.0",
9393
"purgecss-webpack-plugin": "^1.6.0",
94+
"redux-devtools-extension": "^2.13.8",
9495
"resolve-url-loader": "^3.0.0",
9596
"source-map-loader": "^0.2.4",
9697
"style-loader": "^0.23.1",

resources/scripts/state/server/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import socket, { SocketStore } from './socket';
44
import { ServerDatabase } from '@/api/server/getServerDatabases';
55
import files, { ServerFileStore } from '@/state/server/files';
66
import subusers, { ServerSubuserStore } from '@/state/server/subusers';
7+
import { composeWithDevTools } from 'redux-devtools-extension';
78

89
export type ServerStatus = 'offline' | 'starting' | 'stopping' | 'running';
910

@@ -88,4 +89,9 @@ export const ServerContext = createContextStore<ServerStore>({
8889
state.socket.instance = null;
8990
state.socket.connected = false;
9091
}),
91-
}, { name: 'ServerStore' });
92+
}, {
93+
compose: composeWithDevTools({
94+
name: 'ServerStore',
95+
trace: true,
96+
}),
97+
});

webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module.exports = {
5050
cache: true,
5151
target: 'web',
5252
mode: process.env.NODE_ENV,
53-
devtool: isProduction ? false : 'eval-source-map',
53+
devtool: isProduction ? false : process.env.DEVTOOL || 'source-map',
5454
performance: {
5555
hints: false,
5656
},

yarn.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6136,6 +6136,10 @@ readdirp@^2.2.1:
61366136
micromatch "^3.1.10"
61376137
readable-stream "^2.0.2"
61386138

6139+
redux-devtools-extension@^2.13.8:
6140+
version "2.13.8"
6141+
resolved "https://registry.yarnpkg.com/redux-devtools-extension/-/redux-devtools-extension-2.13.8.tgz#37b982688626e5e4993ff87220c9bbb7cd2d96e1"
6142+
61396143
redux-thunk@^2.3.0:
61406144
version "2.3.0"
61416145
resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.3.0.tgz#51c2c19a185ed5187aaa9a2d08b666d0d6467622"

0 commit comments

Comments
 (0)