fix: share replace global define config#1902
Conversation
✅ Deploy Preview for rolldown-rs canceled.
|
✅ Deploy Preview for rolldown-rs canceled.
|
| fs, | ||
| plugin_driver, | ||
| meta: TaskContextMeta { | ||
| replace_global_define_config: if !options.define.is_empty() { |
There was a problem hiding this comment.
I guess you could just put ReplaceGlobalDefinesConfig in the options.define.
There was a problem hiding this comment.
The only thing I am hesitated to do that is if we want the raw NormalizedBundlerOptions in the future. For now the NormalizedBundlerOptions is almost 1:1 for rolldown.config.js. Is it worth to preserve 1:1 semantic of the original configuration?
There was a problem hiding this comment.
No need worried about that. The purpose of NormalizedBundlerOptions is make we happy, no need to dealing with something raw. However, the current implementation of the PR is also fine.
There was a problem hiding this comment.
Ok, then I will replace it until we find it is necessary to keep the config as is.
There was a problem hiding this comment.
If we replace define with ReplaceGlobalDefinesConfig(but we need handle error and propagate errors), which will lead change all upstream function return types to Result<T>. let's merge it first.
Benchmarks Rust |
Description