From ba61fdf979062ab1a201e96ad167ae5c73a0cf78 Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Thu, 20 Feb 2025 10:14:53 +0100 Subject: [PATCH] feat: Document native Vite support --- packages/vite/README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/vite/README.md b/packages/vite/README.md index ffccf2a..13bf485 100644 --- a/packages/vite/README.md +++ b/packages/vite/README.md @@ -4,8 +4,29 @@ Injects Debug IDs into source and sourcemaps when using Vite. +Vite v6.1.1 and later support debug IDs natively without any plugins. Just set +`build.rollupOptions.output.sourcemapDebugIds: true`: + `vite.config.mjs` +```ts +export default { + root: "./src", + mode: "production", + build: { + outDir: "./dist", + sourcemap: true, + rollupOptions: { + output: { + sourcemapDebugIds: true, + }, + }, + }, +}; +``` + +For older versions of Vite, you can use this plugin to inject debug IDs: + ```ts import debugIds from "@debugids/vite";