-
-
Notifications
You must be signed in to change notification settings - Fork 612
Description
- Rollup Plugin Name:
@rollup/plugin-node-resolve - Rollup Plugin Version: 16.0.1
Feature Use Case
Currently, @rollup/plugin-node-resolve relies on resolve, a resolver created and maintained by Browserify, which hasn't been actively maintained and lacks the export map feature.
Rollup builds @rollup/plugin-node-resolve on top of resolve with extra code to handle the browser field and export map.
The resolve plugin is a hot path during the build process, ranging from 10 to thousands or even more. Rustifying the resolver could benefit performance.
Feature Proposal
Maybe Rollup could rustify the resolve part, starting with @rollup/plugin-node-resolve. It is possible to use a Rust-based resolver, like oxc-resolver or rspack-resolver directly. Rollup could also build a rollup-flavored one on top of those crates.
Also, those resolvers already support features (that resolve doesn't have) like export map and the browser field, so @rollup/plugin-node-resolve wouldn't need to re-implement those features again.
After experimenting with @rollup/plugin-node-resolve, we could then decide whether the Rollup core's built-in resolver can benefit from rustify as well.