Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

setup-browser-sdk-sourcemaps

БесплатноБез исполняемых скриптовНе проверен

Configure build-time JavaScript sourcemap upload to Datadog using the Datadog build plugin (@datadog/esbuild-plugin, @datadog/rollup-plugin…

datadog-labsот datadog-labs★ 188 звёзд на GitHub

Об этом скилле

Set up Datadog sourcemap upload via the build plugin

Adds build-time sourcemap upload to a frontend project using the Datadog build plugin. Sourcemaps are uploaded as part of the build, so every deploy ships un-minified stack traces to RUM and Error Tracking. Git metadata is attached automatically, which links errors back to source files.

Follow steps 1-7 in order.

Before starting any work: Create exactly 7 todo items — one per step below. Do not begin implementation until all 7 todos are created. Do not compress or merge steps.

Never invent a value. Three fields (service, releaseVersion, minifiedPathPrefix) must match how the app is actually deployed. If you cannot read a value from the repo, stop and ask the user. Do not write a placeholder, a TODO, or a guessed hostname.

Scope

In scope: projects built by esbuild, Rollup, Rspack, Vite, or webpack — including meta-frameworks that expose one of these directly in their own config file (e.g. Remix/React Router v7+ framework mode, SvelteKit, Nuxt via vite.config.ts/nuxt.config.ts's vite: key). If Step 1's config-file search below finds a real bundler config, the meta-framework sitting on top of it does not change anything — wire the plugin into that config file exactly as normal.

Out of scope: Next.js and Turbopack specifically. Unlike the meta-frameworks above, Next.js does not expose a plain webpack/Turbopack config surface the plugin can hook into — it has no Next.js or Turbopack integration at all. For those, use the datadog-ci sourcemaps upload CLI in a postbuild script instead — do not attempt to thread the webpack plugin through next.config.js.

If a project uses some other meta-framework not listed here and Step 1 finds no plain bundler config file to edit, stop and ask rather than guessing whether it's supported.

Step 1: Detect the bundler

Search for a bundler config file:

find . -maxdepth 1 \( -name "vite.config.*" -o -name "rollup.config.*" -o -name "webpack.config.*" -o -name "rspack.config.*" -o -name "esbuild.config.*" \) 2>/dev/null
grep -l -E "\"(vite|rollup|webpack|@rspack/core|esbuild)\"" package.json

Use find, not ls with these glob patterns directly — in zsh, an ls invocation with multiple glob patterns aborts with no matches found the moment any one pattern fails to match, even with 2>/dev/null appended, because the failure happens during shell word-expansion before ls ever runs. find does its own pattern matching internally, so it works identically in bash and zsh and correctly returns nothing (not an error) when no bundler config exists.

Map the result:

Config file Bundler Package to install Named export
vite.config.{js,ts,mjs} Vite @datadog/vite-plugin datadogVitePlugin
webpack.config.{js,ts,mjs} webpack @datadog/webpack-plugin datadogWebpackPlugin
rollup.config.{js,ts,mjs} Rollup @datadog/rollup-plugin datadogRollupPlugin
rspack.config.{js,ts,mjs} Rspack @datadog/rspack-plugin datadogRspackPlugin
esbuild build script esbuild @datadog/esbuild-plugin datadogEsbuildPlugin

Supported bundler versions:

Bundler Supported range
esbuild any
Rollup >= 3 < 5
Rspack 1.x or 2.x
Vite >= 5 <= 8
webpack >= 5 < 6

Stop and ask the user if: no bundler config is found, more than one is found (monorepo — ask which app to instrument), Next.js or Turbopack is detected (out of scope, see above), or the bundler version is outside the supported range.

Step 2: Collect the three required values

The plugin will not build without these three. Read them from the repo; ask the user for anything you cannot read.

service — must equal the service passed to datadogRum.init(). Datadog matches uploaded sourcemaps to incoming errors on this value. A mismatch means the sourcemaps upload successfully and are never used.

grep -rn "datadogRum.init" --include="*.ts" --include="*.tsx" --include="*.js" --include="*.jsx" -A 15

If the grep finds no datadogRum.init() call anywhere, stop: this skill only adds sourcemap upload to an existing RUM setup, it does not instrument RUM itself. Tell the user Browser RUM needs to be set up first, then re-run this skill.

If datadogRum.init() has no service, stop and tell the user: sourcemaps cannot be matched without it, and it must be added to the RUM init first.

releaseVersion — must be exactly the version passed to datadogRum.init(), because Datadog matches uploads to errors on that string. Copy it as written: version: '1.4.2' means releaseVersion: '1.4.2', and if it reads a variable, read the same variable. Don't swap in a commit SHA or CI variable that datadogRum.init() doesn't use, even if it looks like a better version: it won't match. Leave datadogRum.init() as it is. Can be set here, or once at the top level as metadata.version. If both are set and

Полный SKILL.md на GitHub

Установить setup-browser-sdk-sourcemaps в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл setup-browser-sdk-sourcemaps?

Configure build-time JavaScript sourcemap upload to Datadog using the Datadog build plugin (@datadog/esbuild-plugin, @datadog/rollup-plugin, @datadog/rspack-plugin, @datadog/vite-plugin, @datadog/webpack-plugin), so RUM and Error Tracking show un-minified stack traces with git metadata attached. Use when errors in Datadog show minified stack traces, when asked to "upload sourcemaps", "set up sourcemaps", "unminify errors", or "configure the Datadog build plugin", or when a project has a bundler config and @datadog/browser-rum but no sourcemap upload.

Как установить скилл setup-browser-sdk-sourcemaps?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл setup-browser-sdk-sourcemaps запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить setup-browser-sdk-sourcemaps с