MCPcopy Index your code
hub / github.com/freshframework/fresh / onwarn

Function onwarn

packages/plugin-vite/src/mod.ts:181–214  ·  view source on GitHub ↗
(warning, handler)

Source from the content-addressed store, hash-verified

179 "_fresh/server",
180 rollupOptions: {
181 onwarn(warning, handler) {
182 // Ignore "use client"; warnings
183 if (warning.code === "MODULE_LEVEL_DIRECTIVE") {
184 return;
185 }
186
187 // Ignore optional export errors
188 if (
189 warning.code === "MISSING_EXPORT" &&
190 warning.id?.startsWith("\0fresh-route::")
191 ) {
192 return;
193 }
194
195 // Ignore commonjs optional exports
196 if (
197 warning.code === "MISSING_EXPORT" &&
198 warning.message.includes("__require")
199 ) {
200 return;
201 }
202
203 // Ignore this warnings
204 if (warning.code === "THIS_IS_UNDEFINED") {
205 return;
206 }
207
208 // Ignore falsy source map errors
209 if (warning.code === "SOURCEMAP_ERROR") {
210 return;
211 }
212
213 return handler(warning);
214 },
215 input: {
216 "server-entry": "fresh:server_entry",
217 },

Callers

nothing calls this directly

Calls 1

handlerFunction · 0.50

Tested by

no test coverage detected