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

Treeshaking shaked variable that is used #4336

Closed
Tracked by #4327
JSerFeng opened this issue Oct 16, 2023 · 2 comments · Fixed by #5050
Closed
Tracked by #4327

Treeshaking shaked variable that is used #4336

JSerFeng opened this issue Oct 16, 2023 · 2 comments · Fixed by #5050
Assignees
Labels
team The issue/pr is created by the member of Rspack.

Comments

@JSerFeng
Copy link
Collaborator

Repro

webpack-test/configCases/split-chunks/async-entries

input:

import { parentPort } from "worker_threads";
import value from "./module";

parentPort.on("message", async data => {
	const { upper } = await import("./chunk");
	parentPort.postMessage(`data: ${upper(data)}, value: ${value}, thanks`);
});

output:

__webpack_require__.r(__webpack_exports__);
/* harmony import */var worker_threads__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* worker_threads */"409");
/* harmony import */var worker_threads__WEBPACK_IMPORTED_MODULE_0__default = /*#__PURE__*/__webpack_require__.n(worker_threads__WEBPACK_IMPORTED_MODULE_0_);


/* "worker_threads" unused */null("message", async (data)=>{
    const { upper } = await __webpack_require__.el(/* ./chunk */"52").then(__webpack_require__.bind(__webpack_require__, /* ./chunk */"52"));
    /* "worker_threads" unused */null(`data: ${upper(data)}, value: ${/* "./module" unused */null}, thanks`);
});
},
@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Oct 16, 2023
Copy link

stale bot commented Dec 15, 2023

This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@IWANABETHATGUY
Copy link
Contributor

bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants