Skip to content

[Feature Request]: Warn when dependency is in esmExternalRequirePlugin and external #6027

@TheAlexLichter

Description

@TheAlexLichter

What problem does this feature solve?

When using esmExternalRequirePlugin, people might accidentally forget to remove the dependency from the top-level external options, the plugin won't work. Example:

import { defineConfig } from "rolldown";
import { esmExternalRequirePlugin } from "rolldown/experimental";

export default defineConfig({
  input: "src/index.js",
  external: ["react"],
  plugins: [
    esmExternalRequirePlugin({
      external: ["react"],
    }),
  ],
});

Related: #6022 (comment)

What does the proposed API look like?

Just throw an error (or warn) in that case, inform the user about the miscommunication.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions