fix: get_external_target_from_global_obj may be wrong #1293
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
之前 #1254 中,从 globalThis 上取 external 的方式改成了 globalThis['xxx'], 如果用户配的 external 是形如 'window._',会取不到。
解法:根据点号 '.' split external 配置, 只将左侧第一部分用中括号索引取值,其余保持原始取值方法,即 globalThis['window']._
Summary by CodeRabbit
resolve/mod.rs
中get_external_target_from_global_obj
功能,使其能够处理包含点号的external
字符串。