<commit_before>var path = require('path'),
    argv = require('yargs').argv,
    _ = require('lodash'),
    webpack = require('webpack');

var playgroundPath = __dirname,
    rootPath = path.join(playgroundPath, '..'),
    modulesPath = path.join(rootPath, 'node_modules'),
    cwd = process.cwd();

var resolvePath = function(userPath) {
  return path.resolve(cwd, userPath);
};

var config = {},
    userConfig;

try {
  userConfig = require(
    resolvePath(argv.configPath || 'component-playground.config'));
} catch (e) {
  if (e instanceof Error && e.code === 'MODULE_NOT_FOUND') {
    userConfig = {};
  } else {
    throw e;
  }
}

config.server = _.extend({
  port: 8989,
  hostname: 'localhost'
}, userConfig.server);

config.webpack = {
  context: playgroundPath,
  entry: [
    'webpack-dev-server/client?http://localhost:' + config.server.port,
    'webpack/hot/dev-server',
    './entry'
  ],
  resolve: {
    alias: {
      components: resolvePath(argv.componentsPath || 'components'),
      fixtures: resolvePath(argv.fixturesPath || 'fixtures')
    },
    extensions: ['', '.js', '.jsx']
  },
  resolveLoader: {
    root: modulesPath
  },
  module: {
    loaders: [{
      test: /\.jsx?$/,
      exclude: /node_modules/,
      loaders: ['react-hot-loader', 'babel-loader']
    }, {
      test: /\.css$/,
      loader: 'style-loader!css-loader'
    }, {<commit_msg>Set hostname for HMR<commit_after>var path = require('path'),
    argv = require('yargs').argv,
    _ = require('lodash'),
    webpack = require('webpack');

var playgroundPath = __dirname,
    rootPath = path.join(playgroundPath, '..'),
    modulesPath = path.join(rootPath, 'node_modules'),
    cwd = process.cwd();

var resolvePath = function(userPath) {
  return path.resolve(cwd, userPath);
};

var config = {},
    userConfig;

try {
  userConfig = require(
    resolvePath(argv.configPath || 'component-playground.config'));
} catch (e) {
  if (e instanceof Error && e.code === 'MODULE_NOT_FOUND') {
    userConfig = {};
  } else {
    throw e;
  }
}

config.server = _.extend({
  port: 8989,
  hostname: 'localhost'
}, userConfig.server);

config.webpack = {
  context: playgroundPath,
  entry: [
    'webpack-dev-server/client?http://' + config.server.hostname + ':' +
                                          config.server.port,
    'webpack/hot/dev-server',
    './entry'
  ],
  resolve: {
    alias: {
      components: resolvePath(argv.componentsPath || 'components'),
      fixtures: resolvePath(argv.fixturesPath || 'fixtures')
    },
    extensions: ['', '.js', '.jsx']
  },
  resolveLoader: {
    root: modulesPath
  },
  module: {
    loaders: [{
      test: /\.jsx?$/,
      exclude: /node_modules/,
      loaders: ['react-hot-loader', 'babel-loader']
    }, {
      test: /\.css$/,
      loader: 'style-loader!css-loader'
    }, {
{'fraction_non_alphanumeric': 0.1751412429378531, 'fraction_numerical': 0.002824858757062147, 'mean_word_length': 2.870218579234973, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5299735', 'n_tokens_mistral': 949, 'n_tokens_neox': 931, 'n_words': 176}