<commit_before>/*****************************************************************************
 *
 * WARNING: DO NOT EDIT THIS FILE!
 *
 * This is the standard webpack configuration for our team's apps.
 *
 * This configuration can be customized by passing configOptions.
 *
 * Read more on the wiki:
 * https://git.empdev.domo.com/AppTeam6/da-webpack/wiki/Webpack-Configuration
 *
 *****************************************************************************/

module.exports = function getConfig(configOptions) {

// Handle options
const INCLUDE_DESKTOP_VIEW = (configOptions.hasOwnProperty('includeDesktopView') ? configOptions.includeDesktopView : true);
const INCLUDE_RESPONSIVE_VIEW = (configOptions.hasOwnProperty('includeResponsiveView') ? configOptions.includeResponsiveView : true);

// dependencies
const fs = require('fs');
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const NgAnnotatePlugin = require('ng-annotate-webpack-plugin');

// postcss plugins
const precss = require('precss');
const postcssImport = require('postcss-import');
const reporter = require('postcss-reporter');
const cssnano = require('cssnano');
const messages = require('postcss-browser-reporter');
const autoprefixer = require('autoprefixer');

// Environment
const ON_DEV = process.env.NODE_ENV === 'development' || !process.env.NODE_ENV;
const ON_TEST = process.env.NODE_ENV === 'test';
const ON_PROD = process.env.NODE_ENV === 'production';
const pkg = require('../package.json');
const bannerText = fs.readFileSync(path.resolve(__dirname, '../BANNER.txt')).toString();

const config = {
  cache: false,
  context: path.resolve(__dirname, '../src'),

  // We will add entry points based on the platform configs.
  entry: {},

  // where 3rd-party modules can reside
  resolve: {
    modulesDirectories: ['node_modules', 'bower_components']
  },

  output: {
    // where to put standalone build file
    path: './dist',
    publicPath: '',
    filename: '/[name]/[name].js',
    sourceMapFilename: '[file].map',
    libraryTarget: 'umd'
  },

  // dependencies listed here will NOT be bundled into the app, even if you `require` them.
  externals: {
    'angular': {
      root: 'angular',
      commonjs: 'angular',
      commonjs2: 'angular',
      amd: 'angular'
    },
    'lodash': {
      root: '_',
      commonjs: 'lodash',
      commonjs2: 'lodash',
      amd: 'lodash'
    },
    'jquery': {
      root: '$',
      commonjs: 'jquery',
      commonjs2: 'jquery',
      amd: 'jQuery'
    },
    'd3': {
      root: 'd3',
      commonjs: 'd3',
      commonjs2: 'd3',
      amd: 'd3'
    }
  },

  // optimization plugins
  // we add more items to this array based on configs set at top of file.
  plugins: [
    new webpack.optimize.OccurenceOrderPlugin(),
    new webpack.ResolverPlugin(
      new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('bower.json', ['main'])
    ),
    new webpack.optimize.DedupePlugin(),
    new NgAnnotatePlugin({
      add: true,
      remove: false
    }),
    new webpack.BannerPlugin(bannerText),
    new webpack.DefinePlugin({
      ON_DEV: ON_DEV,
      ON_TEST: ON_TEST,
      ON_PROD: ON_PROD
    })
  ],

  // what loaders to use based on file type.
  module: {
    preLoaders: [
      {
        test: /\.js$/,
        loader: 'eslint-loader',
        exclude: /(node_modules|bower_components)/,
      }<commit_msg>fix(webpack.config): reveal process.env.NODE_ENV to node modules<commit_after>/*****************************************************************************
 *
 * WARNING: DO NOT EDIT THIS FILE!
 *
 * This is the standard webpack configuration for our team's apps.
 *
 * This configuration can be customized by passing configOptions.
 *
 * Read more on the wiki:
 * https://git.empdev.domo.com/AppTeam6/da-webpack/wiki/Webpack-Configuration
 *
 *****************************************************************************/

module.exports = function getConfig(configOptions) {

// Handle options
const INCLUDE_DESKTOP_VIEW = (configOptions.hasOwnProperty('includeDesktopView') ? configOptions.includeDesktopView : true);
const INCLUDE_RESPONSIVE_VIEW = (configOptions.hasOwnProperty('includeResponsiveView') ? configOptions.includeResponsiveView : true);

// dependencies
const fs = require('fs');
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const NgAnnotatePlugin = require('ng-annotate-webpack-plugin');

// postcss plugins
const precss = require('precss');
const postcssImport = require('postcss-import');
const reporter = require('postcss-reporter');
const cssnano = require('cssnano');
const messages = require('postcss-browser-reporter');
const autoprefixer = require('autoprefixer');

// Environment
const ON_DEV = process.env.NODE_ENV === 'development' || !process.env.NODE_ENV;
const ON_TEST = process.env.NODE_ENV === 'test';
const ON_PROD = process.env.NODE_ENV === 'production';
const pkg = require('../package.json');
const bannerText = fs.readFileSync(path.resolve(__dirname, '../BANNER.txt')).toString();

const config = {
  cache: false,
  context: path.resolve(__dirname, '../src'),

  // We will add entry points based on the platform configs.
  entry: {},

  // where 3rd-party modules can reside
  resolve: {
    modulesDirectories: ['node_modules', 'bower_components']
  },

  output: {
    // where to put standalone build file
    path: './dist',
    publicPath: '',
    filename: '/[name]/[name].js',
    sourceMapFilename: '[file].map',
    libraryTarget: 'umd'
  },

  // dependencies listed here will NOT be bundled into the app, even if you `require` them.
  externals: {
    'angular': {
      root: 'angular',
      commonjs: 'angular',
      commonjs2: 'angular',
      amd: 'angular'
    },
    'lodash': {
      root: '_',
      commonjs: 'lodash',
      commonjs2: 'lodash',
      amd: 'lodash'
    },
    'jquery': {
      root: '$',
      commonjs: 'jquery',
      commonjs2: 'jquery',
      amd: 'jQuery'
    },
    'd3': {
      root: 'd3',
      commonjs: 'd3',
      commonjs2: 'd3',
      amd: 'd3'
    }
  },

  // optimization plugins
  // we add more items to this array based on configs set at top of file.
  plugins: [
    new webpack.optimize.OccurenceOrderPlugin(),
    new webpack.ResolverPlugin(
      new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('bower.json', ['main'])
    ),
    new webpack.optimize.DedupePlugin(),
    new NgAnnotatePlugin({
      add: true,
      remove: false
    }),
    new webpack.BannerPlugin(bannerText),
    new webpack.DefinePlugin({
      ON_DEV: ON_DEV,
      ON_TEST: ON_TEST,
      ON_PROD: ON_PROD,
      'process.env': {
        'NODE_ENV': JSON.stringify(process.env.NODE_ENV)
      }
    })
  ],

  // what loaders to use based on file type.
  module: {
    preLoaders: [
      {
        test: /\.js$/,
        loader: 'eslint-loader',
        exclude: /(node_modules|bower_components)/,
      }
{'fraction_non_alphanumeric': 0.1775021385799829, 'fraction_numerical': 0.003136583974907328, 'mean_word_length': 3.4910371318822024, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '3921665', 'n_tokens_mistral': 2162, 'n_tokens_neox': 2090, 'n_words': 518}