How to use the ts-loader/dist/logger.makeLogger function in ts-loader

To help you get started, we’ve selected a few ts-loader examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zeit / ncc / src / loaders / ts-loader.js View on Github external
// we re-export so that we generate a unique
// optional bundle for the ts-loader, that
// doesn't get loaded unless the user is
// compiling typescript
const logger = require("ts-loader/dist/logger");
const makeLogger = logger.makeLogger;
logger.makeLogger = function (loaderOptions, colors) {
  const instance = makeLogger(loaderOptions, colors);
  const logWarning = instance.logWarning;
  instance.logWarning = function (message) {
    // Disable TS Loader TypeScript compatibility warning
    if (message.indexOf('This version may or may not be compatible with ts-loader') !== -1)
      return;
    return logWarning(message);
  };
  return instance;
};

module.exports = require("ts-loader");

// ts-loader internally has a require("typescript") that applies
// regardless of "compiler".
github zeit / ncc / src / loaders / ts-loader.js View on Github external
// we re-export so that we generate a unique
// optional bundle for the ts-loader, that
// doesn't get loaded unless the user is
// compiling typescript
const logger = require("ts-loader/dist/logger");
const makeLogger = logger.makeLogger;
logger.makeLogger = function (loaderOptions, colors) {
  const instance = makeLogger(loaderOptions, colors);
  const logWarning = instance.logWarning;
  instance.logWarning = function (message) {
    // Disable TS Loader TypeScript compatibility warning
    if (message.indexOf('This version may or may not be compatible with ts-loader') !== -1)
      return;
    return logWarning(message);
  };
  return instance;
};

module.exports = require("ts-loader");

// ts-loader internally has a require("typescript") that applies
// regardless of "compiler".
// We could remap this too, as soon as ncc supports aliased externals