Closed simondotm closed 1 year ago
Theres a rumour this used to work on Nx v11.x , but I cant find the github issue I spotted with this info in it
It's Nx issue 5762
It's Nx issue 5762
Copying the issue so the related fix can be tracked: https://github.com/nrwl/nx/issues/5762
Recent Nx changes offer some new possibilities here, observer on the tsc process could be just the ticket Dropping here for reference https://github.com/AgentEnder/nx/commit/c95f24660c14b82034d5393e97195cfc99fea009
Great project!!!
I've solved this issue outside nx by building the library INTO the functions folder. Not sure this strategy would work in this case. I see you're copying the built library only once. Any chance to update it on every change as well?
I wrote my recipe for the non-nx solution, hope it could be of use. Let me know If I can get involved somehow. Auto-refreshing the firebase functions is a dream of mine.
Thanks for sharing your approach, and yes, I'd love to get this working somehow.
Building libraries directly into the functions folder is a neat idea but doesn't feel quite right as a solution for Nx workspaces since we cant always be sure a given buildable library won't be a dependency of multiple apps in the workspace.
Generally seems like we'll need to somehow figure out how an nx plugin can watch specific folders or dependencies (we do know all of the target libraries that a functions application depends on, so thats a good start) and then run its own logic (copying the updated lib outputs in our case) whenever there's a change detected.
Reading the comments in various Nx threads though atm, I get the feeling this functionality exists but is a little bit fragile - keeps working, then not working across recent releases. I'm tempted to see how Nx team resolve some of these features, and then we can follow their examples.
I'm always open to ideas though!
See #95
Scenario: Functions project depends on
node-library
Runbuild --with-deps --watch
Changes to dependencies and/or main application code result in inconsistent rebuildsLook into nx-watch plugin to resolve this https://gist.github.com/jhesgodi/2d530753c551ace665a8c3010d3a719c