Skip to content

Commit 060afaf

Browse files
committed
chore(solidstart): Add sourcemap instructions to README
1 parent b71d0fd commit 060afaf

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

packages/solidstart/README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,55 @@ render(
161161
document.getElementById('root'),
162162
);
163163
```
164+
165+
# Sourcemaps and Releases
166+
167+
To generate and upload source maps of your Solid Start app use our vite bundler plugin.
168+
169+
1. Install the Sentry vite plugin
170+
171+
```bash
172+
# Using npm
173+
npm install @sentry/vite-plugin --save-dev
174+
175+
# Using yarn
176+
yarn add @sentry/vite-plugin --dev
177+
```
178+
179+
2. Configure the vite plugin
180+
181+
To upload source maps you have to configure an auth token. Auth tokens can be passed to the plugin explicitly with the `authToken` option, with a `SENTRY_AUTH_TOKEN` environment variable, or with an `.env.sentry-build-plugin` file in the working directory when building your project. We recommend you add the auth token to your CI/CD environment as an environment variable.
182+
183+
Learn more about configuring the plugin in our [Sentry Vite Plugin documentation](https://www.npmjs.com/package/@sentry/vite-plugin).
184+
185+
```bash
186+
// .env.sentry-build-plugin
187+
SENTRY_AUTH_TOKEN=<your auth token>
188+
SENTRY_ORG=<your org>
189+
SENTRY_PROJECT=<your project name>
190+
```
191+
192+
3. Finally, add the plugin to your `app.config.ts` file.
193+
194+
```javascript
195+
import { defineConfig } from '@solidjs/start/config'
196+
import { sentryVitePlugin } from '@sentry/vite-plugin'
197+
198+
export default defineConfig({
199+
// rest of your config
200+
// ...
201+
202+
vite: {
203+
build: {
204+
sourcemap: true,
205+
},
206+
plugins: [
207+
sentryVitePlugin({
208+
org: process.env.SENTRY_ORG,
209+
project: process.env.SENTRY_PROJECT,
210+
authToken: process.env.SENTRY_AUTH_TOKEN,
211+
}),
212+
],
213+
},
214+
})
215+
```

0 commit comments

Comments
 (0)