(err: CompilerError, asWarning = false)
| 74 | const { code } = compile(template, opts) |
| 75 | |
| 76 | function onError(err: CompilerError, asWarning = false) { |
| 77 | const message = asWarning |
| 78 | ? err.message |
| 79 | : `Template compilation error: ${err.message}` |
| 80 | const codeFrame = |
| 81 | err.loc && |
| 82 | generateCodeFrame( |
| 83 | template as string, |
| 84 | err.loc.start.offset, |
| 85 | err.loc.end.offset, |
| 86 | ) |
| 87 | warn(codeFrame ? `${message}\n${codeFrame}` : message) |
| 88 | } |
| 89 | |
| 90 | // The wildcard import results in a huge object with every export |
| 91 | // with keys that cannot be mangled, and can be quite heavy size-wise. |
no test coverage detected