<commit_before>/**
 * Wepback configuration for the node server.
 */

const path = require('path');
const fs = require('fs');

const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const { CheckerPlugin } = require('awesome-typescript-loader')

const externals = {};
fs.readdirSync('node_modules')
.filter(function(x) {
  return ['.bin'].indexOf(x) === -1;
})
.forEach(function(mod) {
  externals[mod] = 'commonjs ' + mod;
});

const plugins = [
  new CheckerPlugin(),
  new webpack.BannerPlugin({
    banner: 'require("source-map-support").install();',
    raw: true,
  }),
  // Here we install the speak-to-me api into static
  new CopyWebpackPlugin([
    { from: 'node_modules/speaktome-api/build/stm_web.min.js',
        to: '../static/js/lib' },
  ]),
  // Until we ship our plugin API we simply copy these over.
  new CopyWebpackPlugin([
    { from: 'src/adapters/', to: 'adapters/' },
  ])
];

module.exports = {
  entry: './src/app.js',
  target: 'node',
  node: {
    __dirname: false,
    __filename: false,
  },
  resolve: {
    extensions: ['.ts', '.js'],
  },
  output: {
    path: path.join(__dirname, 'build'),
    filename: 'gateway.js'
  },
  module: {
    loaders: [
      {
        test: /\.tsx?$/,
        loader: 'awesome-typescript-loader'
      }
    ],
  },
  devtool: 'sourcemap',
  plugins,
  externals,
}<commit_msg>Enable support for __dirname<commit_after>/**
 * Wepback configuration for the node server.
 */

const path = require('path');
const fs = require('fs');

const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const { CheckerPlugin } = require('awesome-typescript-loader')

const externals = {};
fs.readdirSync('node_modules')
.filter(function(x) {
  return ['.bin'].indexOf(x) === -1;
})
.forEach(function(mod) {
  externals[mod] = 'commonjs ' + mod;
});

const plugins = [
  new CheckerPlugin(),
  new webpack.BannerPlugin({
    banner: 'require("source-map-support").install();',
    raw: true,
  }),
  // Here we install the speak-to-me api into static
  new CopyWebpackPlugin([
    { from: 'node_modules/speaktome-api/build/stm_web.min.js',
        to: '../static/js/lib' },
  ]),
  // Until we ship our plugin API we simply copy these over.
  new CopyWebpackPlugin([
    { from: 'src/adapters/', to: 'adapters/' },
  ])
];

module.exports = {
  entry: './src/app.js',
  target: 'node',
  node: {
    __dirname: true,
    __filename: false,
  },
  resolve: {
    extensions: ['.ts', '.js'],
  },
  output: {
    path: path.join(__dirname, 'build'),
    filename: 'gateway.js'
  },
  module: {
    loaders: [
      {
        test: /\.tsx?$/,
        loader: 'awesome-typescript-loader'
      }
    ],
  },
  devtool: 'sourcemap',
  plugins,
  externals,
}
{'fraction_non_alphanumeric': 0.18129496402877698, 'fraction_numerical': 0.0007194244604316547, 'mean_word_length': 3.101769911504425, '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': '7416070', 'n_tokens_mistral': 967, 'n_tokens_neox': 957, 'n_words': 211}