Skip to content

chore(solidstart): Add sourcemap instructions to README #13268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions packages/solidstart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<your auth token>
SENTRY_ORG=<your org>
SENTRY_PROJECT=<your project name>
```

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,
}),
],
},
});
```
Loading