<commit_before>/* eslint-disable */
const fs = require('fs')
const path = require('path')
const webpack = require('webpack')

const VARIABLES = [
  'APPLICATION_NAME',
  'FB_APP_ID',
  'FB_PERMISSIONS',
  'MEDIA_EXTENSIONS',
  'MEDIA_PIXELS_LARGE',
  'MEDIA_PIXELS_SMALL',
]

const ENVIRONMENT = process.env.NODE_ENV
const PRODUCTION = ENVIRONMENT === 'production'
const SOURCEMAP = process.env.SOURCEMAP

const library = 'axis-wiki'
const filename = PRODUCTION ? `${library}.min.js` : `${library}.js`

const PLACEHOLDER = 'PLACEHOLDER'

const uglify = new webpack.optimize.UglifyJsPlugin({ minimize: true })
const ConfigPlugin = new webpack.DefinePlugin({
  'process.env': VARIABLES.reduce((o, key) => {
    o[key] = JSON.stringify(process.env[key] || false)
    return o
  }, { NODE_ENV: JSON.stringify('production') })
})
const serverSideModules = fs.readdirSync('node_modules')
  .filter(x => ['.bin'].indexOf(x) === -1)
  .reduce((mods, mod) => Object.assign(mods, { [mod]: `commonjs ${mod}` }))

const bundle = {
  entry: PLACEHOLDER,
  module: {
    loaders: [{
      test:    /\.js$/,
      loader:  'babel-loader',
      exclude: /node_modules/,
    }],
  },
  output: {
    filename: PLACEHOLDER,
    library,
    path:     PLACEHOLDER,
    libraryTarget:  'umd',
    umdNamedDefine: true,
  },
  plugins: PRODUCTION ? [ConfigPlugin, uglify] : [ConfigPlugin],
}

module.exports = [
  Object.assign({}, bundle, {
    /* Main JS Bundle */
    devtool: SOURCEMAP ? 'inline-source-map' : 'none',
    entry: `${__dirname}/source/application/Application.js`,
    externals: {
      'React': 'React',
      'react': 'React',
      'react-dom': 'ReactDOM',
      'react-router': 'ReactRouter',
    },
    output: Object.assign({}, bundle.output, {
      filename: 'application.js',
      path: `${__dirname}/build/js`,
    }),
  }),

  Object.assign({}, bundle, {
    /* Dependencies JS Bundle */
    entry: `${__dirname}/vendor/dependencies.js`,
    output: Object.assign({}, bundle.output, {
      filename: 'dependencies.js',
      path: `${__dirname}/build/js`,
    }),
  }),

  // Object.assign({}, bundle, {
  //   /* Server */
  //   entry: `${__dirname}/server/server.js`,
  //   externals: serverSideModules,
  //   output: {
  //     filename: 'server.js',
  //     path: `${__dirname}/build/server`,
  //   },
  //   plugins: PRODUCTION ? [uglify] : [],
  //   target: 'node',<commit_msg>Updating webpack config to honor ENVIRONMENT, and includes which have marked ReactDOM as an external<commit_after>/* eslint-disable */
const fs = require('fs')
const path = require('path')
const webpack = require('webpack')

const VARIABLES = [
  'APPLICATION_NAME',
  'FB_APP_ID',
  'FB_PERMISSIONS',
  'MEDIA_EXTENSIONS',
  'MEDIA_PIXELS_LARGE',
  'MEDIA_PIXELS_SMALL',
]

const ENVIRONMENT = process.env.NODE_ENV
const PRODUCTION = ENVIRONMENT === 'production'
const SOURCEMAP = process.env.SOURCEMAP

const library = 'axis-wiki'
const filename = PRODUCTION ? `${library}.min.js` : `${library}.js`

const PLACEHOLDER = 'PLACEHOLDER'

const uglify = new webpack.optimize.UglifyJsPlugin({ minimize: true })
const ConfigPlugin = new webpack.DefinePlugin({
  'process.env': VARIABLES.reduce((o, key) => {
    o[key] = JSON.stringify(process.env[key] || false)
    return o
  }, { NODE_ENV: JSON.stringify(ENVIRONMENT) })
})
const serverSideModules = fs.readdirSync('node_modules')
  .filter(x => ['.bin'].indexOf(x) === -1)
  .reduce((mods, mod) => Object.assign(mods, { [mod]: `commonjs ${mod}` }))

const bundle = {
  entry: PLACEHOLDER,
  module: {
    loaders: [{
      test:    /\.js$/,
      loader:  'babel-loader',
      exclude: /node_modules/,
    }],
  },
  output: {
    filename: PLACEHOLDER,
    library,
    path:     PLACEHOLDER,
    libraryTarget:  'umd',
    umdNamedDefine: true,
  },
  plugins: PRODUCTION ? [ConfigPlugin, uglify] : [ConfigPlugin],
}

module.exports = [
  Object.assign({}, bundle, {
    /* Main JS Bundle */
    devtool: SOURCEMAP ? 'inline-source-map' : 'none',
    entry: `${__dirname}/source/application/Application.js`,
    externals: {
      'React': 'React',
      'react': 'React',
      'ReactDOM': 'ReactDOM',
      'react-dom': 'ReactDOM',
      'react-router': 'ReactRouter',
    },
    output: Object.assign({}, bundle.output, {
      filename: 'application.js',
      path: `${__dirname}/build/js`,
    }),
  }),

  Object.assign({}, bundle, {
    /* Dependencies JS Bundle */
    entry: `${__dirname}/vendor/dependencies.js`,
    output: Object.assign({}, bundle.output, {
      filename: 'dependencies.js',
      path: `${__dirname}/build/js`,
    }),
  }),

  // Object.assign({}, bundle, {
  //   /* Server */
  //   entry: `${__dirname}/server/server.js`,
  //   externals: serverSideModules,
  //   output: {
  //     filename: 'server.js',
  //     path: `${__dirname}/build/server`,
  //   },
  //   plugins: PRODUCTION ? [uglify] : [],
  //   target: 'node',
{'fraction_non_alphanumeric': 0.18157787718584792, 'fraction_numerical': 0.00040666937779585197, 'mean_word_length': 3.20786997433704, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3902445', 'n_tokens_mistral': 1734, 'n_tokens_neox': 1745, 'n_words': 331}