<commit_before>/* global __dirname, module, require */
const path = require("path");

module.exports = (options) => {
  if (options.entry === undefined) {
    throw Error("options.entry must be specified.")
  }
  if (options.filename === undefined) {
    throw Error("options.Filename must be specified.")
  }
  if (options.library === undefined) {
    throw Error("options.library must be specified.")
  }

  return {
    entry: options.entry,
    output: {
      filename: options.filename,
      library: options.library,
      libraryTarget: "umd2",
      umdNamedDefine: false
    },
    externals: options.externals,
    resolve: {
      extensions: [".ts"]
    },
    devtool: "source-map",
    module: {
      loaders: [
        {
          enforce: "pre",
          test: /\.ts$/,
          loader: "tslint-loader",
          exclude: /node_modules/,
          options: {
            failOnHint: true,
            configFile: path.join("config", "tslint.json"),
          }
        },
        {
          test: /\.ts$/,
          loader: "ts-loader",
          options: {
            configFile: path.join("config", "tsconfig.webpack.json")
          }
        }
      ]
    },
  };
};
<commit_msg>build: define module name for AMD export (#118)<commit_after>/* global __dirname, module, require */
const path = require("path");

module.exports = (options) => {
  if (options.entry === undefined) {
    throw Error("options.entry must be specified.")
  }
  if (options.filename === undefined) {
    throw Error("options.Filename must be specified.")
  }
  if (options.library === undefined) {
    throw Error("options.library must be specified.")
  }

  return {
    entry: options.entry,
    output: {
      filename: options.filename,
      library: options.library,
      libraryTarget: "umd2",
      umdNamedDefine: true
    },
    externals: options.externals,
    resolve: {
      extensions: [".ts"]
    },
    devtool: "source-map",
    module: {
      loaders: [
        {
          enforce: "pre",
          test: /\.ts$/,
          loader: "tslint-loader",
          exclude: /node_modules/,
          options: {
            failOnHint: true,
            configFile: path.join("config", "tslint.json"),
          }
        },
        {
          test: /\.ts$/,
          loader: "ts-loader",
          options: {
            configFile: path.join("config", "tsconfig.webpack.json")
          }
        }
      ]
    },
  };
};

{'fraction_non_alphanumeric': 0.14793624846751124, 'fraction_numerical': 0.002043318348998774, 'mean_word_length': 1.88, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2247286', 'n_tokens_mistral': 728, 'n_tokens_neox': 715, 'n_words': 161}