Hey! :wave: Is there any way to serve a different ...
# javascript
n
Hey! 👋 Is there any way to serve a different resource depending on a Gradle property? Basically, I’m creating App links and I need a different
.well-known/assetlinks.json
on
staging
than on
prod
. Thanks!
I’ve seen people using different gradle modules for each environment, but static files will only be served from the
app
module, right?
e
Just guessing here, you could implement a custom copy task and reference the file under the copy directory.
âž• 1
n
You mean a gradle copy task, right? And having a
staging/assetlinks.json
and a
prod/assetlinks.json
and copy to the root folder depending on the gradle property.
e
Yes exactly. You can make the task depend on the dev or prod K/JS task.
(theoretically, you may need to find out the correct insertion point for your task)
n
Ok, I’ll give it a try, thanks for the idea!
You can make the task depend on the dev or prod K/JS task.
Would that be
:Task compileKotlinJs
?
e
@Nacho Ruiz Martin you may be better off with
jsProcessResources
Make your copy task run before it.
n
Ok, thanks!
Works just as expected, many thanks!