as your question is still missunderstood, here a solution that might help, at least for dynamic imports:
so setting
{
"public": {
"packages": {
"dynamic-import": {
"useLocationOrigin": true
}
}
}
}
this fixes lazy load on different hosts (e.g. hostname and ip adress).
you still can’t use relativ paths, but i think that would not be a solution to your problem.
Be aware that ROOT_URL might also be used in stuff like emails (for password reset links), but that should be easier to work around.
Another solution is to configure the DNS in your private network to resolve the public hostname to the internal ip adress