spatie / flare-vite-plugin-sourcemap-uploader

A Vite plugin for uploading sourcemaps to Flare
https://flareapp.io
MIT License
2 stars 2 forks source link

Vite plugin for sending sourcemaps to Flare

The Flare Vite plugin helps you send sourcemaps of your compiled JavaScript code to Flare. This way, reports sent using the @flareapp/flare-client will be formatted correctly.

Additionally, it automatically passes the Flare API key to @flareapp/flare-client. This way, flare.light() works without any additional configuration.

Check the JavaScript error tracking section in the Flare documentation for more information.

Looking for the Flare client? Go to the @flareapp/flare-client repo.

Installation

Install the plugin using NPM or Yarn:

yarn add @flareapp/vite-plugin-sourcemap-uploader
# or
npm install @flareapp/vite-plugin-sourcemap-uploader

Next, add the plugin to your vite.config.js file:

import { defineConfig } from 'vite';
import flareSourcemapUploader from '@flareapp/vite-plugin-sourcemap-uploader';

export default defineConfig({
    plugins: [
        flareSourcemapUploader({
            key: 'YOUR API KEY HERE'
        }),
    ],
});

Run the vite build command to make sure the sourcemaps are generated. You should see the following lines in the output:

@flareapp/flare-vite-plugin-sourcemaps: Uploading 12 sourcemap files to Flare.
@flareapp/flare-vite-plugin-sourcemaps: Successfully uploaded sourcemaps to Flare.

Configuration

development

Publish a new release:

npm version patch
npm publish

Tag the release:

git tag VERSION
git push origin VERSION

Replace VERSION with v + the version from package.json — for example, v1.0.2