MCPcopy Create free account
hub / github.com/developit/microbundle / onwarn

Function onwarn

src/index.js:466–479  ·  view source on GitHub ↗
(warning, warn)

Source from the content-addressed store, hash-verified

464 },
465
466 onwarn(warning, warn) {
467 // https://github.com/rollup/rollup/blob/0fa9758cb7b1976537ae0875d085669e3a21e918/src/utils/error.ts#L324
468 if (warning.code === 'UNRESOLVED_IMPORT') {
469 stdout(
470 `Failed to resolve the module ${warning.source} imported by ${warning.importer}` +
471 `\nIs the module installed? Note:` +
472 `\n ↳ to inline a module into your bundle, install it to "devDependencies".` +
473 `\n ↳ to depend on a module via import/require, install it to "dependencies".`,
474 );
475 return;
476 }
477
478 warn(warning);
479 },
480
481 treeshake: {
482 propertyReadSideEffects: false,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…