Open jacob-ebey opened 1 year ago
this sounds reasonable
Would adding 'react-server' to conditions in this new option allow to import functions which need a different condition including all their imports and sub-imports? This would allow to run a react server component server without pre-bundling the parts which need a the 'react-server' condition or avoid running them in a second process.
What is the problem this feature would solve?
When implementing things like bundler plugins it's common to receive input such as:
with the requirement of resolving it to the version you would like bundled. The common way of accomplishing this in node-land without too much effort is to use the
enhanced-resolve
npm package maintained by the Webpack team.What is the feature you are proposing to solve the problem?
I'm proposing that we extend
Bun.resolve
andBun.resolveSync
to accept a third parameter of options that allows customization of the resolution algorithm.This would allow resolution for assets such as CSS, JSON, JS, TS, etc when piecing together bun-bundler / bun runtime plugins. One less dependency to take on that Bun already knows how to handle internally in a more efficient way.
What alternatives have you considered?
N/A, please raise alternatives.