Skip to content

Commit d653627

Browse files
author
Sébastien Henau
committed
chore: update the vite readme.md
1 parent 15b9b53 commit d653627

File tree

1 file changed

+13
-41
lines changed

1 file changed

+13
-41
lines changed

packages/vite/README.md

Lines changed: 13 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,36 @@
1-
# Vite plugin for sending sourcemaps to Flare
1+
# @flareapp/vite
22

3-
The Flare Vite plugin helps you send sourcemaps of your compiled JavaScript code to Flare. This way, reports sent using the `@flareapp/js` will be formatted correctly.
3+
Vite build plugin for [Flare](https://flareapp.io) that uploads sourcemaps after each build. With sourcemaps, error reports sent by `@flareapp/js` will show the original source code instead of minified output.
44

5-
Additionally, it automatically passes the Flare API key to `@flareapp/js`. This way, `flare.light()` works without any additional configuration.
6-
7-
Check the JavaScript error tracking section in [the Flare documentation](https://flareapp.io/docs/javascript-error-tracking/installation) for more information.
5+
The plugin also injects the Flare API key and a sourcemap version identifier into your build, so `flare.light()` works without any additional configuration.
86

97
## Installation
108

11-
Install the plugin using NPM or Yarn:
12-
139
```bash
14-
yarn add @flareapp/vite
15-
# or
1610
npm install @flareapp/vite
1711
```
18-
Next, add the plugin to your `vite.config.js` file:
1912

20-
```js
13+
## Quick start
14+
15+
Add the plugin to your `vite.config.ts`:
16+
17+
```ts
2118
import { defineConfig } from 'vite';
2219
import flareSourcemapUploader from '@flareapp/vite';
2320

2421
export default defineConfig({
2522
plugins: [
2623
flareSourcemapUploader({
27-
key: 'YOUR API KEY HERE'
24+
key: 'YOUR_FLARE_API_KEY',
2825
}),
2926
],
3027
});
3128
```
3229

33-
Run the `vite build` command to make sure the sourcemaps are generated. You should see the following lines in the output:
34-
35-
```bash
36-
@flareapp/flare-vite-plugin-sourcemaps: Uploading 12 sourcemap files to Flare.
37-
@flareapp/flare-vite-plugin-sourcemaps: Successfully uploaded sourcemaps to Flare.
38-
```
39-
40-
## Configuration
41-
42-
- `key: string` **(required)**: the Flare API key
43-
- `base: string`: the base path of built output (defaults to Vite's base path)
44-
- `runInDevelopment: boolean`: whether to upload sourcemaps when `NODE_ENV=development` or when running the dev server (defaults to `false`)
45-
- `version: string`: the sourcemap version (defaults to a fresh `uuid` per build)
46-
- `removeSourcemaps: boolean`: whether to remove the sourcemaps after uploading them (defaults to `false`). Comes in handy when you want to upload sourcemaps to Flare but don't want them published in your build.
47-
48-
## development
49-
50-
Publish a new release:
51-
52-
```bash
53-
npm version patch
54-
npm publish
55-
```
30+
## Documentation
5631

57-
Tag the release:
32+
Full documentation on configuration options, sourcemap resolution, and more is available at [flareapp.io/docs/javascript/general/resolving-bundled-code](https://flareapp.io/docs/javascript/general/resolving-bundled-code).
5833

59-
<pre>
60-
git tag <var>VERSION</var>
61-
git push origin <var>VERSION</var>
62-
</pre>
34+
## License
6335

64-
Replace <var>VERSION</var> with `v` + the version from `package.json`for example, `v1.0.2`
36+
The MIT License (MIT). Please see [License File](../../LICENSE.md) for more information.

0 commit comments

Comments
 (0)