()
| 45 | * This function is separate from the main getNunjucksEngine to avoid circular dependencies |
| 46 | */ |
| 47 | export function getNunjucksEngineForFilePath(): nunjucks.Environment { |
| 48 | const env = nunjucks.configure({ |
| 49 | autoescape: false, |
| 50 | }); |
| 51 | |
| 52 | // Add environment variables as template globals |
| 53 | env.addGlobal('env', { |
| 54 | ...process.env, |
| 55 | ...cliState.config?.env, |
| 56 | }); |
| 57 | |
| 58 | return env; |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * Loads content from an external file if the input is a file path, otherwise |
no outgoing calls
no test coverage detected
searching dependent graphs…