How to use the kyt-utils/logger.debug function in kyt-utils

To help you get started, weā€™ve selected a few kyt-utils 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 nytimes / kyt / packages / kyt-core / utils / buildConfigs.js View on Github external
// Merge options with static webpack configs
  clientConfig = merge.smart(baseConfig(clientOptions), clientConfig(clientOptions));
  serverConfig = merge.smart(baseConfig(serverOptions), serverConfig(serverOptions));

  // Modify via userland config
  try {
    clientConfig = config.modifyWebpackConfig(clone(clientConfig), clientOptions);
    serverConfig = config.modifyWebpackConfig(clone(serverConfig), serverOptions);
  } catch (error) {
    logger.error('Error in your kyt.config.js modifyWebpackConfig():', error);
    process.exit(1);
  }

  if (config.debug) {
    logger.debug('Client webpack configuration:', clientConfig);
    logger.debug('\n\n');
    logger.debug('Server webpack configuration:', serverConfig);
  }

  // A "main" entry is required in the server config.
  if (!serverConfig.entry.main) {
    logger.error(
      'A main entry is required in the server configuration. Found: ',
      serverConfig.entry
    );
    process.exit(1);
  }

  return {
    clientConfig,
    serverConfig,
github nytimes / kyt / packages / kyt-core / utils / buildConfigs.js View on Github external
clientConfig = merge.smart(baseConfig(clientOptions), clientConfig(clientOptions));
  serverConfig = merge.smart(baseConfig(serverOptions), serverConfig(serverOptions));

  // Modify via userland config
  try {
    clientConfig = config.modifyWebpackConfig(clone(clientConfig), clientOptions);
    serverConfig = config.modifyWebpackConfig(clone(serverConfig), serverOptions);
  } catch (error) {
    logger.error('Error in your kyt.config.js modifyWebpackConfig():', error);
    process.exit(1);
  }

  if (config.debug) {
    logger.debug('Client webpack configuration:', clientConfig);
    logger.debug('\n\n');
    logger.debug('Server webpack configuration:', serverConfig);
  }

  // A "main" entry is required in the server config.
  if (!serverConfig.entry.main) {
    logger.error(
      'A main entry is required in the server configuration. Found: ',
      serverConfig.entry
    );
    process.exit(1);
  }

  return {
    clientConfig,
    serverConfig,
  };
};
github nytimes / kyt / packages / kyt-core / utils / buildConfigs.js View on Github external
// Merge options with static webpack configs
  clientConfig = merge.smart(baseConfig(clientOptions), clientConfig(clientOptions));
  serverConfig = merge.smart(baseConfig(serverOptions), serverConfig(serverOptions));

  // Modify via userland config
  try {
    clientConfig = config.modifyWebpackConfig(clone(clientConfig), clientOptions);
    serverConfig = config.modifyWebpackConfig(clone(serverConfig), serverOptions);
  } catch (error) {
    logger.error('Error in your kyt.config.js modifyWebpackConfig():', error);
    process.exit(1);
  }

  if (config.debug) {
    logger.debug('Client webpack configuration:', clientConfig);
    logger.debug('\n\n');
    logger.debug('Server webpack configuration:', serverConfig);
  }

  // A "main" entry is required in the server config.
  if (!serverConfig.entry.main) {
    logger.error(
      'A main entry is required in the server configuration. Found: ',
      serverConfig.entry
    );
    process.exit(1);
  }

  return {
    clientConfig,
    serverConfig,
  };
github nytimes / kyt / packages / kyt-core / cli / actions / proto.js View on Github external
const startPrototype = () => {
    // Build webpack config
    let webpackConfig = merge.smart(baseConfig(options), protoConfig(options));
    webpackConfig = config.modifyWebpackConfig(webpackConfig, options);

    // Preparing prototype compiler
    let compiler = null;
    try {
      if (config.debug) logger.debug('Prototype Config', webpackConfig);
      compiler = webpack(webpackConfig);
    } catch (error) {
      logger.error('Webpack config is invalid\n', error);
      process.exit();
    }

    // Creates a webpack dev server at the specified port
    server = new WebpackDevServer(compiler, webpackConfig.devServer);
    server.listen(prototypeURL.port, prototypeURL.hostname, () => {
      logger.end(`webpack-dev-server ${prototypeURL.href}prototype`);
    });
  };
  logger.start('Configuring Prototype...');

kyt-utils

A shared kyt utility library.

Apache-2.0
Latest version published 12 months ago

Package Health Score

75 / 100
Full package analysis

Similar packages