Socket
Book a DemoInstallSign in
Socket

@backtrace/vite-plugin

Package Overview
Dependencies
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@backtrace/vite-plugin

Backtrace Vite plugin

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
153
98.7%
Maintainers
3
Weekly downloads
 
Created
Source

@backtrace/vite-plugin

If you're using Vite as your project bundler, you can use @backtrace/vite-plugin to automate working with sourcemaps.

(Source Map feature documentation)

Enable Source Maps for Your Application

Set sourcemap in output to true in your vite.config.js:

module.exports = {
    build: {
        sourcemap: true,
    },
};

If you're using code transpiler plugins (such as Typescript), ensure to enable source-mapping there as well.

Set up @backtrace/vite-plugin

Construct an upload URL

A specific URL is required to upload source maps. Follow these instructions to create an upload URL for the sourcemap endpoint with a symbol-post token.

Install @backtrace/vite-plugin as a developer dependency:

> npm install --save-dev @backtrace/vite-plugin

Add it to your plugins array in vite.config.js:

import { BacktracePlugin } from '@backtrace/vite-plugin';
// or
const { BacktracePlugin } = require('@backtrace/vite-plugin');

module.exports = {
    // other configuration
    plugins: [
        new BacktracePlugin({
            // enable upload only on production builds
            uploadUrl: process.env.NODE_ENV === 'production' ? '<your upload URL>' : undefined,
        }),
    ],
};

Keywords

Error

FAQs

Package last updated on 30 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts