<commit_before>var path = require('path')
var fixtures = path.resolve.bind(path, __dirname, 'src')
var resolver = require('custom-resolve')
var promisify = require('node-promisify')
var styleResolve = promisify(resolver({
  main: 'style',
  extensions: '.css',
  moduleDirectory: ['web_modules', 'node_modules'],
}))

module.exports = {
  getStyle: function (jsFile) {
    if (jsFile.indexOf(fixtures('page') + '/') === 0) {
      return path.dirname(jsFile) + '/index.css'
    }
    var prefix = fixtures('web_modules') + '/'
    if (jsFile.indexOf(prefix) === 0) {
      return styleResolve(
        jsFile.slice(prefix.length).split('/')[0],
        { filename: jsFile }
      )
    }

    prefix = fixtures('node_modules') + '/'
    if (jsFile.indexOf(prefix) === 0) {
      return styleResolve(
        jsFile.slice(prefix.length).split('/')[0],
        { filename: jsFile }
      )
    }
  },

  basedir: fixtures(),
  paths: [fixtures('web_modules')],

  on: {
    log: console.log.bind(console),
    error: function (err) {
      console.log(err.stack)
    },
  },

  js: {
    entries: 'page/**/*.js',
    bundleOptions: {
      groups: '**/page/**/index.js',
      common: 'common.js',
    },
    dest: 'build',
  },

  css: {
    atRuleName: 'external',
    bundleOptions: {
      groups: '**/page/**/index.css',
      common: 'common.css',
    },
    resolve: styleResolve,
    dest: 'build',
  },
}
<commit_msg>Fix example<commit_after>var path = require('path')
var fixtures = path.resolve.bind(path, __dirname, 'src')
var resolver = require('custom-resolve')
var promisify = require('node-promisify')
var styleResolve = promisify(resolver({
  main: 'style',
  extensions: '.css',
  moduleDirectory: ['web_modules', 'node_modules'],
}))

module.exports = {
  getStyle: function (jsFile) {
    if (jsFile.indexOf(fixtures('page') + '/') === 0) {
      return path.dirname(jsFile) + '/index.css'
    }
    var prefix = fixtures('web_modules') + '/'
    if (jsFile.indexOf(prefix) === 0) {
      return styleResolve(
        jsFile.slice(prefix.length).split('/')[0],
        { filename: jsFile }
      )
    }

    prefix = fixtures('node_modules') + '/'
    if (jsFile.indexOf(prefix) === 0) {
      return styleResolve(
        jsFile.slice(prefix.length).split('/')[0],
        { filename: jsFile }
      )
    }
  },

  basedir: fixtures(),
  paths: [fixtures('web_modules')],

  on: {
    log: console.log.bind(console),
    error: function (err) {
      console.log(err.stack)
    },
  },

  js: {
    entries: 'page/**/*.js',
    bundleOptions: {
      groups: '**/page/**/index.js',
      common: 'common.js',
    },
    dest: 'build',
  },

  css: {
    entries: '**/page/**/index.css',
    atRuleName: 'external',
    bundleOptions: {
      groups: '**/page/**/index.css',
      common: 'common.css',
    },
    resolve: styleResolve,
    dest: 'build',
  },
}

{'fraction_non_alphanumeric': 0.1914672216441207, 'fraction_numerical': 0.00346860908775581, 'mean_word_length': 2.7454545454545456, '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': '1517498', 'n_tokens_mistral': 993, 'n_tokens_neox': 981, 'n_words': 179}