<commit_before>var webpack = require('webpack');
var candelaLoaders = require('../webpack');
var path = require('path');

var HtmlPlugin = require('html-webpack-plugin');

var examples = require('./index.json');

var entryPoints = examples.map(function (ex) {
  return {
    key: ex.link,
    value: './' + ex.link + '/index.js'
  };
});

var entry = {};
entryPoints.forEach(function (ep) {
  entry[ep.key] = ep.value;
});

var htmlPlugins = examples.map(function (ex) {
  return new HtmlPlugin({
    title: ex.title,
    filename: ex.link + '/index.html',
    chunks: [ex.link]
  });
});

module.exports = candelaLoaders({
  entry: entry,
  output: {
    path: 'build',
    filename: '[name]/index.js'
  },
  plugins: htmlPlugins.concat([
    new webpack.ProvidePlugin({
      jQuery: 'jquery'
    })
  ]),
  module: {
    loaders: [
      {
        test: /\.js$/,
        loader: 'babel-loader',
        query: {
          presets: ['es2015']
        },
        exclude: /node_modules/
      },
      {
        test: /\.json$/,
        loader: 'json-loader',
        exclude: /node_modules/
      },
      {
        test: /\.csv|\.tsv$/,
        loader: 'raw-loader',
        exclude: /node_modules/
      },
      {
        test: /\.jade$/,
        loader: 'jade-loader',
        exclude: /node_modules/
      },
      {
        test: /\.styl/,
        loaders: ['style-loader', 'css-loader', 'stylus-loader'],
        exclude: /node_modules/
      },
      {
        test: /\.css/,
        loaders: ['style-loader', 'css-loader'],
        include: /node_modules\/nvd3/,
      },
      {
        test: /\.js$/,
        loaders: [
          'exports-loader?GLO',
          'imports-loader?_=underscore&cola=webcola'
        ],
        include: __dirname + '/node_modules/glo/glo.js'
      },
    ]
  }
});
<commit_msg>refactor(examples): build examples in top-level build directory<commit_after>var webpack = require('webpack');
var candelaLoaders = require('../webpack');
var path = require('path');

var HtmlPlugin = require('html-webpack-plugin');

var examples = require('./index.json');

var entryPoints = examples.map(function (ex) {
  return {
    key: ex.link,
    value: './' + ex.link + '/index.js'
  };
});

var entry = {};
entryPoints.forEach(function (ep) {
  entry[ep.key] = ep.value;
});

var htmlPlugins = examples.map(function (ex) {
  return new HtmlPlugin({
    title: ex.title,
    filename: ex.link + '/index.html',
    chunks: [ex.link]
  });
});

module.exports = candelaLoaders({
  entry: entry,
  output: {
    path: '../build/examples',
    filename: '[name]/index.js'
  },
  plugins: htmlPlugins.concat([
    new webpack.ProvidePlugin({
      jQuery: 'jquery'
    })
  ]),
  module: {
    loaders: [
      {
        test: /\.js$/,
        loader: 'babel-loader',
        query: {
          presets: ['es2015']
        },
        exclude: /node_modules/
      },
      {
        test: /\.json$/,
        loader: 'json-loader',
        exclude: /node_modules/
      },
      {
        test: /\.csv|\.tsv$/,
        loader: 'raw-loader',
        exclude: /node_modules/
      },
      {
        test: /\.jade$/,
        loader: 'jade-loader',
        exclude: /node_modules/
      },
      {
        test: /\.styl/,
        loaders: ['style-loader', 'css-loader', 'stylus-loader'],
        exclude: /node_modules/
      },
      {
        test: /\.css/,
        loaders: ['style-loader', 'css-loader'],
        include: /node_modules\/nvd3/,
      },
      {
        test: /\.js$/,
        loaders: [
          'exports-loader?GLO',
          'imports-loader?_=underscore&cola=webcola'
        ],
        include: __dirname + '/node_modules/glo/glo.js'
      },
    ]
  }
});

{'fraction_non_alphanumeric': 0.1809832522960562, 'fraction_numerical': 0.002701242571582928, 'mean_word_length': 1.875, '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': '2329673', 'n_tokens_mistral': 1265, 'n_tokens_neox': 1242, 'n_words': 230}