()
| 112 | } |
| 113 | |
| 114 | function throwHtmlParseError() { |
| 115 | return { |
| 116 | name: 'vite-plugin-throw-html-parse-error', |
| 117 | configResolved(config: ResolvedConfig) { |
| 118 | const warn = config.logger.warn |
| 119 | config.logger.warn = (msg, opts) => { |
| 120 | // convert HTML parse warnings to make it easier to test |
| 121 | if (msg.includes('Unable to parse HTML;')) { |
| 122 | throw new Error(msg) |
| 123 | } |
| 124 | warn.call(config.logger, msg, opts) |
| 125 | } |
| 126 | }, |
| 127 | } |
| 128 | } |
| 129 | // #endregion |
| 130 | |
| 131 | // eslint-disable-next-line no-empty-pattern |