When running tsup or tsup-node with a config file (either the standard file name scheme or by setting --config with a file name), esbuild throws an error:
Invalid option in build() call: "watch"
// from node_modules\esbuild\lib\main.js:253:12
❌ The error is thrown:
when using a tsup.config.* config file
when using --config some_config.ts
when using --watchwith a custom config (--config or config file)
All of these even with watch omitted, watch: false or watch: undefined inside the config file.
✔️ The error is not thrown:
when using --no-config
when using --watchwithout a custom config (--config or config file)
Possible cause
So it seems the parsing of the options from a config file handles the watch option different from the CLI --watch argument. Resulting in a --watch argument added to the esbuild command, which is not allowed anymore (see release notes from esbuild).
Upvote & Fund
We're using Polar.sh so you can upvote and help fund this issue.
We receive the funding once the issue is completed & confirmed by you.
Thank you in advance for helping prioritize & fund our backlog.
Problem
When running
tsup
ortsup-node
with a config file (either the standard file name scheme or by setting--config
with a file name), esbuild throws an error:❌ The error is thrown:
tsup.config.*
config file--config some_config.ts
--watch
with a custom config (--config
or config file)All of these even with
watch
omitted,watch: false
orwatch: undefined
inside the config file.✔️ The error is not thrown:
--no-config
--watch
without a custom config (--config
or config file)Possible cause
So it seems the parsing of the options from a config file handles the
watch
option different from the CLI--watch
argument. Resulting in a--watch
argument added to the esbuild command, which is not allowed anymore (see release notes from esbuild).Upvote & Fund