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
Additional directories to watch #3718
Comments
I can't reproduce this. Here's what I tried: $ cat src/project1/main.ts
import '../common/example'
$ cat src/common/example.ts
console.log(1)
$ esbuild --bundle src/project1/main.ts --watch
(() => {
// src/common/example.ts
console.log(1);
})();
[watch] build finished, watching for changes...
[watch] build started (change: "src/common/example.ts")
(() => {
// src/common/example.ts
console.log(2);
})();
[watch] build finished In the above sequence, I changed I'm marking this issue as |
The setup for reproduction is as follows:
In the above sequence, change content of example.ts, i.e. change type name etc. My idea was having tsc running inside esbuild watch: const context = await esbuild.context({
plugins: [{
name: "main",
setup(build) {
build.onEnd(result => {
childProcess.execSync(`tsc -p ${tsConfigPath} --noEmit`, {stdio:"inherit"});
}}}]});
await context.watch(); I understand that So my idea was having a bit more extensible esbuild watch via parameters, or having the watch api exposed? |
@evanw can you please have a look? |
My project structure is as following:
when bundling
src/project1/main.ts
orsrc/project2/main.ts
which depend on files insrc/common
folder usingesbuild.context().watch()
does not register changes insrc/common
. It seems the built-in logic only looks for changes in entryPoint directory and its subdirectories.Is there any build option or watch option to extend the watch over more folders? In my case I would add
src/common
.If not, I can see
WatchOptions
being an empty interface, seems like a good place to extend?My current workaround is:
The text was updated successfully, but these errors were encountered: