How to use webpack-log - 6 common examples

To help you get started, we’ve selected a few webpack-log 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 Atyantik / pawjs / src / server / webpack-start.js View on Github external
// Server configurations
  const serverConfig = wHandler.getConfig(process.env.PAW_ENV, 'server');

  // Web client configurations
  const webConfig = wHandler.getConfig(process.env.PAW_ENV, 'web');

  const devServerConfig = {
    port: pawConfig.port,
    host: pawConfig.host,
    serverSideRender: pawConfig.serverSideRender,
    publicPath: pawConfig.resourcesBaseUrl,
    contentBase: path.join(directories.src, 'public'),
  };

  // Create new logging entity, pawjs
  const log = webLog({
    name: 'pawjs',
  });

  const processEnv = process.env;
  const isVerbose = processEnv.PAW_VERBOSE === 'true';

  const commonOptions = {
    stats: {
      colors: true,
      reasons: isVerbose,
      entrypoints: isVerbose,
      modules: isVerbose,
      moduleTrace: isVerbose,
      assets: true,
      warnings: isVerbose,
      errors: true,
github flaviuse / mern-authentication / client / node_modules / webpack-dev-middleware / lib / fs.js View on Github external
if (!Buffer.isBuffer(content)) {
              // TODO need remove in next major release
              if (Array.isArray(content)) {
                content = content.join('\n');
              }

              content = Buffer.from(content, 'utf8');
            }

            mkdirp.sync(path.dirname(targetPath));

            try {
              fs.writeFileSync(targetPath, content, 'utf-8');

              log.debug(
                colors.cyan(
                  `Asset written to disk: ${path.relative(
                    process.cwd(),
                    targetPath
                  )}`
                )
              );
            } catch (e) {
              log.error(`Unable to write asset to disk:\n${e}`);
            }
          }
        }
      });
    }
github wuct / elastic-apm-sourcemap-webpack-plugin / src / elastic-apm-sourcemap-webpack-plugin.ts View on Github external
emit(
    compilation: webpack.compilation.Compilation,
    callback: (error?: Error) => void
  ): Promise {
    const logger = webpackLog({
      name: 'ElasticAPMSourceMapPlugin',
      level: this.config.logLevel
    });

    logger.debug(`starting uploading sourcemaps with configs: ${JSON.stringify(this.config)}.`);

    const { chunks = [] } = compilation.getStats().toJson();

    return R.compose, Source[], UploadTask[], Promise>(
      (promises: Array>) =>
        Promise.all(promises)
          .then(() => {
            logger.debug('finished uploading sourcemaps.');
            callback();
          })
          .catch(err => {
github pixeloven / pixeloven / packages / pixeloven-core / src / libraries / Logger.ts View on Github external
import log from "webpack-log";
const logger = log({ name: "core" });

export type Message = string | string[];
export type Level = "info" | "warn" | "error";

/**
 * Logs a message as a specific
 * @param message
 * @param level
 */
const messenger = (message: Message, level: Level): void => {
    if (Array.isArray(message)) {
        message.map((item: string) => {
            logger[level](item);
        });
    } else {
        logger[level](message);
github GoogleChromeLabs / critters / src / index.js View on Github external
constructor (options) {
    this.options = Object.assign({ logLevel: 'info' }, options || {});
    this.options.pruneSource = this.options.pruneSource !== false;
    this.urlFilter = this.options.filter;
    if (this.urlFilter instanceof RegExp) {
      this.urlFilter = this.urlFilter.test.bind(this.urlFilter);
    }
    this.logger = log({ name: 'Critters', unique: true, level: this.options.logLevel });
  }
github sikidamjanovic / cowrite / node_modules / webpack-dev-middleware / lib / fs.js View on Github external
return fs.writeFile(targetPath, content, (writeFileError) => {
                if (writeFileError) {
                  return callback(writeFileError);
                }

                log.debug(
                  colors.cyan(
                    `Asset written to disk: ${path.relative(
                      process.cwd(),
                      targetPath
                    )}`
                  )
                );

                return callback();
              });
            });

webpack-log

A logger for the Webpack ecosystem

MPL-2.0
Latest version published 4 years ago

Package Health Score

61 / 100
Full package analysis

Popular webpack-log functions