jsonimportrelative-pathspinnakerjsonnet

Import file in Jsnonnet/libsonnet application using relative path


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


Solution

  • As you already found, import paths are resolved from:

    You can add a another directory to the CLI by:

    In your case, this could be either

    Find more details at: https://www.mankier.com/1/jsonnet#Environment