<commit_before>const path = require('path')

const webpack = require('webpack')
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const ExtractTextPlugin = require('extract-text-webpack-plugin')

const config = require('./webpack.common')
const gonConfig = require('./config')

const PATH = config.PATH
const CWD = process.cwd()

module.exports = [
  {
    name: 'lib',
    entry: PATH.libMin,
    output: {
      path: PATH.entries.build,
      filename: 'lib.min.js',
      publicPath: PATH.publicPath,
    },
    plugins: [
      new webpack.DefinePlugin({
        'process.env': {
          NODE_ENV: JSON.stringify('production'),
        },
      }),
    ],
    resolve: {
      // Tell webpack what directories should be searched when resolving modules.
      modules: [
        PATH.root,
        path.resolve(CWD, 'node_modules'),
        path.resolve(__dirname, '../node_modules'),
      ],
      // or webpack cannot resolve these modules
      // These aliasing is used when trying to resolve a module
      // alias: {
      //   'webpack-hot-middleware/client':
      //   path.resolve(__dirname, '../node_modules/webpack-hot-middleware/client.js'),
      //   'react-hot-loader/patch':
      //   path.resolve(__dirname, '../node_modules/react-hot-loader/patch.js'),
      //   'ansi-html': path.resolve(__dirname, '../node_modules/ansi-html/'),
      //   'html-entities': path.resolve(__dirname, '../node_modules/html-entities/'),
      //   'react-proxy': path.resolve(__dirname, '../node_modules/react-proxy/'),
      //   global: path.resolve(__dirname, '../node_modules/global/'),
      // },
    },
  },
  {
    context: __dirname,
    entry: config.getEntries(PATH.entries),
    output: {
      path: PATH.entries.build,
      filename: '[name].js',
      publicPath: '/static/dist/js',
    },
    resolve: {
      modules: [
        PATH.root,
        path.resolve(CWD, 'node_modules'),
        path.resolve(__dirname, '../node_modules'),
      ],
    },
    resolveLoader: {
      modules: [path.resolve(__dirname, '../node_modules')],
    },
    module: {
      loaders: [
        {
          test: /\.jsx?$/,
          use: [
            {
              loader: 'babel-loader',
              options: {
                presets: [
                  [require.resolve('babel-preset-es2015'), { modules: false }],
                  require.resolve('babel-preset-react'),
                  require.resolve('babel-preset-stage-0'),
                ],
              },
            },
          ],
          exclude: /node_modules/,
        },
        {
          test: /\.styl$/,
          use: [
            ExtractTextPlugin.extract(''),
            {
              loader: 'css-loader',
            },
            {
              loader: 'stylus-loader',
            },
          ],
        },
      ],
    },
    plugins: [
      new ExtractTextPlugin('[name].css'),
      new webpack.DefinePlugin({
        'process.env': {
          NODE_ENV: JSON.stringify('production'),<commit_msg>fix: webpack extract text plugin<commit_after>const path = require('path')

const webpack = require('webpack')
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const ExtractTextPlugin = require('extract-text-webpack-plugin')

const config = require('./webpack.common')
const gonConfig = require('./config')

const PATH = config.PATH
const CWD = process.cwd()

module.exports = [
  {
    name: 'lib',
    entry: PATH.libMin,
    output: {
      path: PATH.entries.build,
      filename: 'lib.min.js',
      publicPath: PATH.publicPath,
    },
    plugins: [
      new webpack.DefinePlugin({
        'process.env': {
          NODE_ENV: JSON.stringify('production'),
        },
      }),
    ],
    resolve: {
      // Tell webpack what directories should be searched when resolving modules.
      modules: [
        PATH.root,
        path.resolve(CWD, 'node_modules'),
        path.resolve(__dirname, '../node_modules'),
      ],
    },
  },
  {
    context: __dirname,
    entry: config.getEntries(PATH.entries),
    output: {
      path: PATH.entries.build,
      filename: '[name].js',
      publicPath: '/static/dist/js',
    },
    resolve: {
      modules: [
        PATH.root,
        path.resolve(CWD, 'node_modules'),
        path.resolve(__dirname, '../node_modules'),
      ],
    },
    resolveLoader: {
      modules: [path.resolve(__dirname, '../node_modules')],
    },
    module: {
      loaders: [
        {
          test: /\.jsx?$/,
          use: [
            {
              loader: 'babel-loader',
              options: {
                presets: [
                  [require.resolve('babel-preset-es2015'), { modules: false }],
                  require.resolve('babel-preset-react'),
                  require.resolve('babel-preset-stage-0'),
                ],
              },
            },
          ],
          exclude: /node_modules/,
        },
        {
          test: /\.styl$/,
          use: ExtractTextPlugin.extract({
            use: [
              'css-loader',
              'stylus-loader',
            ],
          }),
        },
      ],
    },
    plugins: [
      new ExtractTextPlugin('[name].css'),
      new webpack.DefinePlugin({
        'process.env': {
          NODE_ENV: JSON.stringify('production'),
{'fraction_non_alphanumeric': 0.1534431137724551, 'fraction_numerical': 0.0018712574850299401, 'mean_word_length': 1.7551546391752577, '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': '7085343', 'n_tokens_mistral': 1578, 'n_tokens_neox': 1516, 'n_words': 264}