<commit_before>var fs = require('fs')
var path = require('path')
var spawn = require('child_process').spawn
var extend = require('extend')
var _ = require('lodash')
var babelConfig = require('./config/babel.config.js')

var ROOT = process.env.hipley_root || process.cwd()

// Defaults
var defaults = {
  root: ROOT,
  port: process.env.hipley_port || process.env.PORT || 3000,
  proxy: process.env.hipley_proxy || null,
  cmd: process.env.hipley_cmd || null,
  src: process.env.hipley_src || 'src',
  dest: process.env.hipley_dest || 'dist',
  static: process.env.hipley_static || 'public',
  devServer: process.env.hipley_devServer || 3002,
  browserSync: {
    ui: 3001
  },
  vendors: [],
  optional: {
    'react-transform-catch-errors': true
  }
}

// Load .hipleyrc.
var rc = {}
if (fs.existsSync(path.resolve(ROOT, '.hipleyrc'))) {
  try {
    rc = JSON.parse(fs.readFileSync(path.resolve(ROOT, '.hipleyrc')))
  } catch (e) {
    console.log('Error Parsing .hipleyrc', e)
  }
}

var hipley = module.exports = {
  // Merge .hipleyrc into options.
  options: extend(true, {}, defaults, rc),

  // Set or override an option.
  set: function (key, val) {
    hipley.options[key] = val
  },

  // Prepare options from program arguments.
  prepare: function (program) {
    var keys = ['port', 'proxy', 'cmd', 'src', 'dest']
    keys.forEach(function (key) {
      if (program[key]) {
        hipley.set(key, program[key])
      }
    })
  },

  // Get our base babel options and merge in user's .babelrc.
  getBabel: function () {
    // Base babel options.
    var babel = babelConfig(hipley.options)

    // Read app's babelrc and merge into base babel options.
    if (fs.existsSync(path.resolve(ROOT, '.babelrc'))) {
      try {
        var babelrc = JSON.parse(fs.readFileSync(path.resolve(ROOT, '.babelrc')))
        babel = extend(true, {}, babel, babelrc)
      } catch (e) {<commit_msg>Allows getBabel to ignore babelrc.<commit_after>var fs = require('fs')
var path = require('path')
var spawn = require('child_process').spawn
var extend = require('extend')
var _ = require('lodash')
var babelConfig = require('./config/babel.config.js')

var ROOT = process.env.hipley_root || process.cwd()

// Defaults
var defaults = {
  root: ROOT,
  port: process.env.hipley_port || process.env.PORT || 3000,
  proxy: process.env.hipley_proxy || null,
  cmd: process.env.hipley_cmd || null,
  src: process.env.hipley_src || 'src',
  dest: process.env.hipley_dest || 'dist',
  static: process.env.hipley_static || 'public',
  devServer: process.env.hipley_devServer || 3002,
  browserSync: {
    ui: 3001
  },
  vendors: [],
  optional: {
    'react-transform-catch-errors': true
  }
}

// Load .hipleyrc.
var rc = {}
if (fs.existsSync(path.resolve(ROOT, '.hipleyrc'))) {
  try {
    rc = JSON.parse(fs.readFileSync(path.resolve(ROOT, '.hipleyrc')))
  } catch (e) {
    console.log('Error Parsing .hipleyrc', e)
  }
}

var hipley = module.exports = {
  // Merge .hipleyrc into options.
  options: extend(true, {}, defaults, rc),

  // Set or override an option.
  set: function (key, val) {
    hipley.options[key] = val
  },

  // Prepare options from program arguments.
  prepare: function (program) {
    var keys = ['port', 'proxy', 'cmd', 'src', 'dest']
    keys.forEach(function (key) {
      if (program[key]) {
        hipley.set(key, program[key])
      }
    })
  },

  // Get our base babel options and merge in user's .babelrc.
  getBabel: function (ignoreLocal) {
    // Base babel options.
    var babel = babelConfig(hipley.options)

    // Read app's babelrc and merge into base babel options.
    if (!ignoreLocal && fs.existsSync(path.resolve(ROOT, '.babelrc'))) {
      try {
        var babelrc = JSON.parse(fs.readFileSync(path.resolve(ROOT, '.babelrc')))
        babel = extend(true, {}, babel, babelrc)
      } catch (e) {
{'fraction_non_alphanumeric': 0.16137428422696512, 'fraction_numerical': 0.006246746486205101, 'mean_word_length': 3.213815789473684, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3242945', 'n_tokens_mistral': 1366, 'n_tokens_neox': 1327, 'n_words': 318}