Merge pull request #12928 from marcoYxz/honour-removePragmas-when-bundle-workers

Fix removePragmas command line argument and honour removePragmas in the bundleWorker flow
This commit is contained in:
Matt Schwartz 2025-09-28 15:31:05 +00:00 committed by GitHub
commit fb9290a4d4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 1 deletions

View File

@ -431,3 +431,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
- [Easy Mahaffey](https://github.com/easymaahffey)
- [Pamela Augustine](https://github.com/pamelaAugustine)
- [宋时旺](https://github.com/BlockCnFuture)
- [Marco Zhan](https://github.com/marcoYxz)

View File

@ -123,7 +123,7 @@ function handleBuildWarnings(result) {
export async function build() {
// Configure build options from command line arguments.
const minify = argv.minify ?? false;
const removePragmas = argv.pragmas ?? false;
const removePragmas = argv.removePragmas ?? false;
const sourcemap = argv.sourcemap ?? true;
const node = argv.node ?? true;

View File

@ -387,6 +387,9 @@ export async function bundleWorkers(options) {
workerConfig.logOverride = {
"empty-import-meta": "silent",
};
workerConfig.plugins = options.removePragmas
? [stripPragmaPlugin]
: undefined;
} else {
workerConfig.format = "esm";
workerConfig.splitting = true;