Skip to content

Commit 129635c

Browse files
committed
fix: change order
1 parent d69d9b5 commit 129635c

File tree

1 file changed

+10
-12
lines changed
  • docs/platforms/javascript/guides/tanstackstart-react

1 file changed

+10
-12
lines changed

docs/platforms/javascript/guides/tanstackstart-react/index.mdx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -138,30 +138,28 @@ Sentry.init({
138138
});
139139
```
140140

141-
#### Load Instrumentation on Startup
141+
#### Moving the Sentry server config file for production usage
142142

143-
Add a `--import` flag directly or to the `NODE_OPTIONS` environment variable wherever you run your application to import `instrument.server.mjs`.
143+
For production monitoring, the Sentry server config file needs to be moved to your build output. Since [TanStack Start is designed to work with any hosting provider](https://tanstack.com/start/latest/docs/framework/react/guide/hosting), the exact location will depend on where your build artifacts are deployed (for example, `"/dist"`, `".output/server"` or a platform-specific directory).
144144

145-
```json {filename:package.json}
145+
For example, when using [nitro](https://nitro.build/), copy the instrumentation file to `".output/server"`.
146+
147+
```json {diff} {filename:package.json}
146148
{
147149
"scripts": {
148-
"dev": "NODE_OPTIONS='--import ./instrument.server.mjs' vite dev --port 3000",
149-
"start": "node --import ./.output/server/instrument.server.mjs .output/server/index.mjs",
150+
- "build": "vite build",
151+
+ "build": "vite build && cp instrument.server.mjs .output/server",
150152
}
151153
}
152154
```
153155

154-
#### Moving the Sentry server config file for production usage
155-
156-
For production monitoring, the Sentry server config file needs to be moved to your build output. Since [TanStack Start is designed to work with any hosting provider](https://tanstack.com/start/latest/docs/framework/react/guide/hosting), the exact location will depend on where your build artifacts are deployed (for example, `"/dist"`, `".output/server"` or a platform-specific directory).
156+
#### Load Instrumentation on Startup
157157

158-
For example, when using [nitro](https://nitro.build/), copy the instrumentation file to `".output/server"`.
158+
Add a `--import` flag directly or to the `NODE_OPTIONS` environment variable wherever you run your application to import `instrument.server.mjs`.
159159

160-
```json {diff} {filename:package.json}
160+
```json {filename:package.json}
161161
{
162162
"scripts": {
163-
- "build": "vite build",
164-
+ "build": "vite build && cp instrument.server.mjs .output/server",
165163
"dev": "NODE_OPTIONS='--import ./instrument.server.mjs' vite dev --port 3000",
166164
"start": "node --import ./.output/server/instrument.server.mjs .output/server/index.mjs",
167165
}

0 commit comments

Comments
 (0)