|
@@ -22,9 +22,17 @@ const dev = mode === "development";
|
|
|
const sourcemap = dev ? "inline" : false;
|
|
|
const legacy = !!process.env.SAPPER_LEGACY_BUILD;
|
|
|
|
|
|
-const warningIsIgnored = (warning) => warning.message.includes(
|
|
|
+const IGNORED_MESSAGES = [
|
|
|
"Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification",
|
|
|
-) || warning.message.includes("Circular dependency: node_modules");
|
|
|
+ "Circular dependency: node_modules",
|
|
|
+];
|
|
|
+
|
|
|
+const IGNORED_CODES = [
|
|
|
+ "THIS_IS_UNDEFINED",
|
|
|
+];
|
|
|
+
|
|
|
+const warningIsIgnored = (warning) => IGNORED_MESSAGES.some((m) => warning.message.includes(m))
|
|
|
+ || IGNORED_CODES.indexOf(warning.code) >= 0;
|
|
|
|
|
|
// Workaround for https://github.com/sveltejs/sapper/issues/1221
|
|
|
const onwarn = (warning, _onwarn) => (warning.code === "CIRCULAR_DEPENDENCY" && /[/\\]@sapper[/\\]/.test(warning.message)) || warningIsIgnored(warning) || console.warn(warning.toString());
|