Skip to content

Commit 7b170d2

Browse files
chore(solidstart): Add sourcemap instructions to README (#13268)
--------- Co-authored-by: Charly Gomez <charly.gomez@sentry.io>
1 parent b71d0fd commit 7b170d2

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

packages/solidstart/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,59 @@ 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
182+
`authToken` option, with a `SENTRY_AUTH_TOKEN` environment variable, or with an `.env.sentry-build-plugin` file in the
183+
working directory when building your project. We recommend you add the auth token to your CI/CD environment as an
184+
environment variable.
185+
186+
Learn more about configuring the plugin in our
187+
[Sentry Vite Plugin documentation](https://www.npmjs.com/package/@sentry/vite-plugin).
188+
189+
```bash
190+
// .env.sentry-build-plugin
191+
SENTRY_AUTH_TOKEN=<your auth token>
192+
SENTRY_ORG=<your org>
193+
SENTRY_PROJECT=<your project name>
194+
```
195+
196+
3. Finally, add the plugin to your `app.config.ts` file.
197+
198+
```javascript
199+
import { defineConfig } from '@solidjs/start/config';
200+
import { sentryVitePlugin } from '@sentry/vite-plugin';
201+
202+
export default defineConfig({
203+
// rest of your config
204+
// ...
205+
206+
vite: {
207+
build: {
208+
sourcemap: true,
209+
},
210+
plugins: [
211+
sentryVitePlugin({
212+
org: process.env.SENTRY_ORG,
213+
project: process.env.SENTRY_PROJECT,
214+
authToken: process.env.SENTRY_AUTH_TOKEN,
215+
}),
216+
],
217+
},
218+
});
219+
```

0 commit comments

Comments
 (0)