diff --git a/packages/solidstart/README.md b/packages/solidstart/README.md index 61aa3b2793da..b654b9bdf744 100644 --- a/packages/solidstart/README.md +++ b/packages/solidstart/README.md @@ -161,3 +161,59 @@ render( document.getElementById('root'), ); ``` + +# Sourcemaps and Releases + +To generate and upload source maps of your Solid Start app use our Vite bundler plugin. + +1. Install the Sentry Vite plugin + +```bash +# Using npm +npm install @sentry/vite-plugin --save-dev + +# Using yarn +yarn add @sentry/vite-plugin --dev +``` + +2. Configure the vite plugin + +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. + +Learn more about configuring the plugin in our +[Sentry Vite Plugin documentation](https://www.npmjs.com/package/@sentry/vite-plugin). + +```bash +// .env.sentry-build-plugin +SENTRY_AUTH_TOKEN= +SENTRY_ORG= +SENTRY_PROJECT= +``` + +3. Finally, add the plugin to your `app.config.ts` file. + +```javascript +import { defineConfig } from '@solidjs/start/config'; +import { sentryVitePlugin } from '@sentry/vite-plugin'; + +export default defineConfig({ + // rest of your config + // ... + + vite: { + build: { + sourcemap: true, + }, + plugins: [ + sentryVitePlugin({ + org: process.env.SENTRY_ORG, + project: process.env.SENTRY_PROJECT, + authToken: process.env.SENTRY_AUTH_TOKEN, + }), + ], + }, +}); +```