Skip to content

[Feature Request]: support output.noConflict #7724

@simon04

Description

@simon04

What problem does this feature solve?

https://rollupjs.org/configuration-options/#output-noconflict

This will generate an additional noConflict export to UMD bundles. When called in an IIFE scenario, this method will return the bundle exports while restoring the corresponding global variable to its previous value.

Context: we're trying to migrate the leaflet build process to rolldown in Leaflet/Leaflet#10011 and found that output.noConflict is not supported in rolldown v1.0.0-beta.58.

Rollup with output.noConflict yields

  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (function () {
    var current = global.L;
    var exports = global.L = {};
    factory(exports);
    exports.noConflict = function () { global.L = current; return exports; };
  })());

Rolldown does not support this option and yields

  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.L = {})));

What does the proposed API look like?

https://rollupjs.org/configuration-options/#output-noconflict

Metadata

Metadata

Assignees

Priority

None yet

Start date

None yet

Target date

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions