Skip to content

@datadog/rspack-plugin peer-pins @rspack/core "1.x" — verified working with Rspack 2, please widen the range #418

@olaf-cichocki

Description

@olaf-cichocki

What

@datadog/rspack-plugin@3.2.0 (and every published version, including the dev dist-tag 3.1.8-dev.3) declares:

"peerDependencies": {
  "@rspack/core": "1.x"
}

Now that Rspack 2.0 is GA (@rspack/core@2.0.x), this pin blocks installation in any workspace on Rspack 2 — either a hard ERESOLVE/peer error, or it forces keeping a second major of @rspack/core in the tree.

Verified: it already works with Rspack 2 — only the peer range blocks it

I force-installed @datadog/rspack-plugin@3.2.0 against @rspack/core@2.0.8 and ran a production build with RUM SDK injection + devtool: source-map:

  • Build succeeds (Rspack compiled successfully).
  • The plugin's hooks run under Rspack 2 — debug log shows [debug|rspack|build-report] [filling sourcemaps inputs].
  • RUM SDK injection works — the entry bundle grows from 0 B to ~182 KB and contains the DD_RUM runtime plus the injected applicationId / clientToken.
  • Sourcemaps are generated and the plugin collects them.

This lines up with the published entry (packages/published/rspack-plugin/src/index.ts), which just passes rspack to the unplugin factory:

import rspack from '@rspack/core';

export const datadogRspackPlugin = factory.buildPluginFactory({
    bundler: rspack,
    version: pkg.version,
}).rspack;

i.e. the shipped plugin relies on the unplugin Rspack adapter rather than Rspack-1-specific internals (the richer RspackOptions / Stats typings live in packages/tools / packages/tests, not in the published package).

The only thing I didn't exercise is the actual sourcemap upload (needs an API key), but that path is HTTP, not Rspack-version-sensitive.

Ask

  1. If there's no known incompatibility, please widen the peer range to ^1 || ^2 (or 1.x || 2.x).
  2. If Rspack 2 is known to break something, could you note which API/hook, so consumers can plan?

Happy to open a PR for the peer-range change if that's all that's needed.

Context

Large Nx monorepo (~40 apps) with a Module Federation host + remotes, using the plugin in federated builds for RUM + Error Tracking source map upload. We're blocked from moving to Rspack 2 / Rsbuild 2 solely by this peer pin — the rest of our toolchain already supports v2.

Environment

  • @datadog/rspack-plugin: 3.2.0
  • Target @rspack/core: 2.0.8 (engines ^20.19 || >=22.12)
  • Node 24.13.0, pnpm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions