File tree 2 files changed +15
-0
lines changed 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { inspect } from "@xstate/inspect"
1
2
import { createRoot } from "react-dom/client"
3
+ import { Interpreter } from "xstate"
2
4
import { App } from "./app"
3
5
import "./i18n"
4
6
7
+ // if this is a development build and the developer wants to inspect
8
+ // helpful to see realtime changes on the services
9
+ if ( process . env . NODE_ENV === "development" && process . env . INSPECT_XSTATE === "true" ) {
10
+ // configure the XState inspector to open in a new tab
11
+ inspect ( {
12
+ url : "https://stately.ai/viz?inspect" ,
13
+ iframe : false ,
14
+ } )
15
+ // configure all XServices to use the inspector
16
+ Interpreter . defaultOptions . devTools = true
17
+ }
18
+
5
19
// This is the entry point for the app - where everything start.
6
20
// In the future, we'll likely bring in more bootstrapping logic -
7
21
// like: https://github.com/coder/m/blob/50898bd4803df7639bd181e484c74ac5d84da474/product/coder/site/pages/_app.tsx#L32
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export default defineConfig({
13
13
define : {
14
14
"process.env" : {
15
15
NODE_ENV : process . env . NODE_ENV ,
16
+ INSPECT_XSTATE : process . env . INSPECT_XSTATE ,
16
17
} ,
17
18
} ,
18
19
server : {
You can’t perform that action at this time.
0 commit comments