Is there a way to introudce compile-time asset dependency?

Example: I have a module that has compile-time text string that gets read from a file, say, in priv (or, elsewhere in the directory structure). Is there an easy (or hard) way to declare it so that if that the text file changes it “dirties” the module and triggers recompilation via mix?

I seem to recall reading about a way to do this, but I can’t find it anymore, and I’m not sure if was just imagining it.

Thanks in advance!

Yes, it is @external_resource

From doc…

Tools like Mix may use this information to ensure the module is recompiled in case any of the external resources change.

5 Likes

thank you! Oddly I looked through that doc file and didn’t see it, I guess sometimes things are staring at you in the face.

1 Like