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

Selectively exclude rs files from watch when using web start #229

Open
ecumene opened this issue Dec 26, 2019 · 1 comment
Open

Selectively exclude rs files from watch when using web start #229

ecumene opened this issue Dec 26, 2019 · 1 comment

Comments

@ecumene
Copy link

ecumene commented Dec 26, 2019

My build script parses large and constant text files to spit their content into a constants.rs file. The reason for this is to ignore file loading headaches, by already having the file loaded in memory by the time you execute the program.

cargo web start is incompatible with this, because it watches all source files for changes. When a file is changed (like main.rs), it launches a build. The build generates a new constants.rs, and the build restarts again and again, until I kill the process.

I recommend a regex or array in the Web.toml where you can include files to be excluded by the watch, to allow codegen tools and file watching to coexist peacefully 😄!

@ecumene
Copy link
Author

ecumene commented Dec 26, 2019

A temporary fix is to include a flag for your script to run, but that only works in the case where you can get away with running it once in a while

https://stackoverflow.com/questions/52422256/how-can-i-make-running-a-cargo-build-script-optional

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

1 participant