Skip to content

[Feature]: External type with customizable require function #10971

@redstonekasi

Description

@redstonekasi

What problem does this feature solve?

In my environment exists a global require function that is not called require. I would like to use this similar to the commonjs externalsType. Sadly, the function that that externals type uses is not customizable. I have not found any other method for doing this that does not cripple Rspack's optimization features, particularly module concatenation.

What does the proposed API of configuration look like?

Perhaps a new externalsRequire property or an extension to the current commonjs type such as commonjs(object.with.require) where the parameter object.with.require specifies a function accessible on the global. I am honestly uncertain of how best the configuration for this would be exposed and am open to suggestions.

Metadata

Metadata

Assignees

Labels

No fields configured for Enhancement.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions