UNPKG

@soleil-se/build-app

Version:

Script for building WebApps, RESTApps and Widgets with Svelte in Sitevision.

22 lines (17 loc) 744 B
import { logWarning } from '@soleil-se/build-utils/log'; export default function onwarn(warning) { let { message } = warning; if (warning.code === 'CIRCULAR_DEPENDENCY') return; if (warning.code === 'PLUGIN_WARNING') { if (warning.pluginCode && warning.pluginCode === 'a11y-no-onchange') return; } if (warning.code === 'MISSING_NODE_BUILTINS') { if (warning.ids.length === 1 && warning.ids[0] === 'events') return; message = warning.message.replace(/"events", | and "events"|"events" and |"events"/g, ''); } if (warning.code === 'UNRESOLVED_IMPORT') { message = message.replace(' - treating it as an external dependency', '. Have you installed it?'); throw new Error(message); } logWarning(message); }