packages/twig-renderer/twig-renderer.js
async function init(keepAlive = false) {
  state = STATES.STARTING;
  const config = await getConfig();
  const relativeFrom = path.dirname(config.configFileUsed);
  // console.log({ config });
  twigNamespaces = await getTwigNamespaceConfig(
    relativeFrom,
    config.extraTwigNamespaces,
  );
  twigRenderer = new TwigRenderer({
    relativeFrom,
    src: {
      roots: [relativeFrom],
      namespaces: TwigRenderer.convertLegacyNamespacesConfig(twigNamespaces),
    },
    debug: true,
    alterTwigEnv: config.alterTwigEnv,
    hasExtraInfoInResponses: false, // Will add `info` onto results with a lot of info about Twig Env
    maxConcurrency: 50,
    keepAlive, // only set this to be true when doing in-browser requests to avoid issues with this process not exiting when complete
  });
  state = STATES.READY;
}
async function init(keepAlive = false) {
  state = STATES.STARTING;
  const config = await getConfig();
  const relativeFrom = path.dirname(config.configFileUsed);
  // console.log({ config });
  twigNamespaces = await getTwigNamespaceConfig(
    relativeFrom,
    config.extraTwigNamespaces,
  );
  twigRenderer = new TwigRenderer({
    relativeFrom,
    src: {
      roots: [relativeFrom],
      namespaces: TwigRenderer.convertLegacyNamespacesConfig(twigNamespaces),
    },
    debug: true,
    alterTwigEnv: config.alterTwigEnv,
    hasExtraInfoInResponses: false, // Will add `info` onto results with a lot of info about Twig Env
    maxConcurrency: 50,
    keepAlive, // only set this to be true when doing in-browser requests to avoid issues with this process not exiting when complete
  });
  state = STATES.READY;
}
async function init ( keepAlive = false ) { state = STATES . STARTING ; const config = await getConfig ( ) ; const relativeFrom = path . dirname ( config . configFileUsed ) ; // console.log({ config }); twigNamespaces = await getTwigNamespaceConfig ( relativeFrom , config . extraTwigNamespaces , ) ; twigRenderer = new TwigRenderer ( { relativeFrom , src : { roots : [ relativeFrom ] , namespaces : TwigRenderer . convertLegacyNamespacesConfig ( twigNamespaces ) , } , debug : true , alterTwigEnv : config . alterTwigEnv , hasExtraInfoInResponses : false , // Will add `info` onto results with a lot of info about Twig Env maxConcurrency : 50 , keepAlive , // only set this to be true when doing in-browser requests to avoid issues with this process not exiting when complete } ) ; state = STATES . READY ; }
Initialize Twig Renderer instance
@param {Boolean} keepAlive - Optionally tell the Twig renderer service to keep alive to help speed up requests
Initialize Twig Renderer instance