Closed enejm closed 3 years ago
Interesting question. Can I ask how you would be using --watch
with functions? Is it for just checking for compile errors as you work, or for some other interesting reason?
Looks like this was a bug in Nx thats fixed in 12.3.4 - Nx issue 5208 Plugin may need to rearrange the order it does its work however to:
--watch
should work in this case. However changes to dependent libraries wont be detected for rebuilding the functions app output.
I dont think it's going to be trivial to support --watch because we do post processing on the build. I cant do the tsc step last, because it deletes the output folder before compilation (which nukes the package.json and local library deps we've created).
Hmmm....
Regarding the use case:
In regular firebase functions repo I mostly use
npm run build -- --watch | firebase emulators:start
This way I can test functions in functions shell or in frontend app without need to manually rebuild it on every change.
So in regards to issue #9 - I intended to set up nx serve
with build command using --watch flag
Ideal dev experience for fullstack development would be: To serve both functions and frontend app, and any change in apps and especially in common libs would be applied without need to manually rebuild and rerun emulators again.
Hmm, yes, I understand. If it is not trivial issue, than I will stick to "manual". :) Thank you for your time.
Thanks for the extra info. I've got an idea there might be a way to do this, and its a useful thing for the plugin to do, so I'll look into it.
Ok I've figured this out. --watch will be supported in the next release.
v0.2.3 now released against Nx version 12.3.4
--watch
is now supported in v0.2.3 - requires minimum Nx version 12.3.4
Hello. Great plugin. Is there a way to run the builder in watch mode for hot reloading purpose?
I have tried
nx build myapp --watch=true
It starts compilation in watch mode but it exits after first execution.