1.0.0 • Published 2 years ago

vite-plugin-proposal-debug-id v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

vite-plugin-proposal-debug-id

Polyfill Vite Plugin for the TC39 Source Map Debug ID Proposal.

Usage

// vite.config.js
import { defineConfig } from "vite";
import { debugIdProposalPlugin } from "vite-plugin-proposal-debug-id";

export default defineConfig({
  // other options ...
  plugins: [debugIdProposalPlugin()], // put plugin as late as possible
});

Effects

  • Exposes global function property getDebugIdSnippet(url) that allows to extract a Debug Id for a paticular url.
  • Inserts a debugId field into generated source maps.

Attribution

Based on implmentation over at Sentry JavaScript Bundler Plugins.