I have a libsonnet file in which I want to import another libsonnet file proving relative path
I am able to do it by going backward from current folder For example : import ‘../../../abc.libsonnet’
Is there any way to import same by proving relative path from root folder? Something like below import ‘./appl/example/test/abc.libsonnet
I tried this but facing ‘No match locally’ error during runtime
As you already found,
import
paths are resolved from:
You can add a another directory to the CLI by:
-J
arg as:
jsonnet -J <ROOT_DIR> ...
env JSONNET_PATH=<ROOT_DIR> jsonnet ...
In your case, this could be either
$ jsonnet -J "${PWD}/../../../" ...
$ jsonnet -J "$(realpath ../../../)" ...
Find more details at: https://www.mankier.com/1/jsonnet#Environment