We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
System: OS: macOS 15.3.1 CPU: (12) arm64 Apple M3 Pro Memory: 318.75 MB / 36.00 GB Shell: 5.9 - /bin/zsh Browsers: Chrome: 133.0.6943.127 Safari: 18.3 npmPackages: @rsbuild/core: ^1.2.8 => 1.2.11
for some reason prod build marks the exported function as not used.
https://github.com/felixmosh/rsbuild-worker-prod-bug
worker content
The text was updated successfully, but these errors were encountered:
Rspack enables optimization.usedExports in production mode by default, and did not detect that this export was used, so it was tree-shaked.
Rspack cannot statically analyze this syntax:
+ const worker = await eval('import(workerPath)'); if(worker.default && typeof worker.default.default === 'function') { await worker.default.default(); }
Sorry, something went wrong.
Hi @9aoy thank you for the reply...
I've change the eval to __non_webpack_require__, still the same output :| (you can check the change in the repo)
__non_webpack_require__
No branches or pull requests
Version
System: OS: macOS 15.3.1 CPU: (12) arm64 Apple M3 Pro Memory: 318.75 MB / 36.00 GB Shell: 5.9 - /bin/zsh Browsers: Chrome: 133.0.6943.127 Safari: 18.3 npmPackages: @rsbuild/core: ^1.2.8 => 1.2.11
Details
for some reason prod build marks the exported function as not used.
Reproduce link
https://github.com/felixmosh/rsbuild-worker-prod-bug
Reproduce Steps
worker content
)The text was updated successfully, but these errors were encountered: