You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
I am not sure if it definitely needs to be "Rust" to improve performance, but I agree that completely owning the resolver will bring benefits. The greatest benefits I actually see from caching all directory accesses etc. during each build, something that currently is only done in the part handled by the old resolve plugin but not by the new parts.
But sure, it can also be Rust as long as jump between JavaScript and Rust does not become another bottleneck.
Unfortunately, I had little resources to pursue anything here, but I would be open if someone else picked it up.
Uh oh!
There was an error while loading. Please reload this page.
@rollup/plugin-node-resolve
Feature Use Case
Currently,
@rollup/plugin-node-resolve
relies onresolve
, 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 ofresolve
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 thebrowser
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.The text was updated successfully, but these errors were encountered: