Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: panic when get max target in find target #7082

Merged
merged 3 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions crates/rspack_core/src/exports_info.rs
LingyuCoder marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -1293,11 +1293,17 @@ impl ExportInfoId {
if !export_info.target_is_set || export_info.target.is_empty() {
return FindTargetRetEnum::Undefined;
}
let raw_target = export_info
.get_max_target_readonly()
.values()
.next()
.cloned();

let raw_target = if export_info.max_target_is_set {
export_info
.get_max_target_readonly()
LingyuCoder marked this conversation as resolved.
Show resolved Hide resolved
.values()
.next()
.cloned()
} else {
export_info._get_max_target().values().next().cloned()
};

let Some(raw_target) = raw_target else {
return FindTargetRetEnum::Undefined;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { QueryClient } from 'mocklib';

it("should compile", () => {
expect(QueryClient).toBe(1)
});

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**@type {import("@rspack/core").Configuration}*/
module.exports = {
mode: "development",
entry: {
main: "./index.js"
},
optimization: {
providedExports: true,
usedExports: true,
concatenateModules: true,
minimize: false
},
};
Loading