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

Rust compilation output cleared too quikly in watch mode #10

Open
BenoitZugmeyer opened this issue Nov 7, 2020 · 2 comments
Open

Rust compilation output cleared too quikly in watch mode #10

BenoitZugmeyer opened this issue Nov 7, 2020 · 2 comments

Comments

@BenoitZugmeyer
Copy link

I have a small issue when using this plugin with rollup in watch mode. When doing a rust file modification, it seems rollup is bundles the project in two pass, clearing the Rust compilation warnings right after the Rust compilation finishes.

It would be great if rollup could bundle everything in one pass, keeping the Rust compilation visible until another file is modified.

Minimal project to reproduce

Screencast:
asciicast

@BenoitZugmeyer
Copy link
Author

After investigation, it seems that this issue is caused by macOS FSEvent notifying of a change on target/wasm-pack/xxx/index.js even if this file is being watched after the change.

In fact, I can even reproduce in the shell with this command:

wasm-pack build --dev --out-name index --out-dir ./out; fswatch ./out/index.js

fswatch will notify about an update of the watched file even if it is started after watch-pack finishes. Any idea what would cause this?

Because we don't really care about this file being watched, my workaround is to use the Rollup watch.exclude option like so:

  watch: {
    exclude: 'target/wasm-pack/xxx/index.js'
  }

This is not ideal, but it does the job.

@Pauan
Copy link
Collaborator

Pauan commented Nov 21, 2020

@BenoitZugmeyer Thanks for the report, and the investigation. FS events are really wacky on OSX in general, so it doesn't surprise me that it's having problems.

Let me see if it's possible for the plugin to ignore the target folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants