<commit_before>let merge = require('webpack-merge')
let baseConfig = require('./webpack.base.config')
let path = require('path')
let webpack = require('webpack')
let HtmlWebpackPlugin = require('html-webpack-plugin')
let CopyWebpackPlugin = require('copy-webpack-plugin')
let ExtractTextPlugin = require('extract-text-webpack-plugin')
let OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin')
let config = require('./index')
module.exports = merge(baseConfig, {
  output: {
    publicPath: config.prod.publicPath,
    path: path.resolve(__dirname, '../dist'),
    filename: 'static/js/[name].[hash].js',
    chunkFilename: 'static/js/[id].[hash].js'
  },
  module: {
    rules: [{
      test: /\.css$/,
      loader: ExtractTextPlugin.extract({
        fallback: 'style-loader',
        use: 'css-loader'
      })
    }, {
      test: /\.less$/,
      loader: ExtractTextPlugin.extract({
        fallback: 'style-loader',
        use: ['css-loader', 'less-loader']
      })
    }]
  },
  plugins: [
    // 文本拆分插件，单独拆分css文件
    new ExtractTextPlugin({filename: 'static/css/[hash].css'}),
    // css压缩插件
    new OptimizeCssAssetsPlugin({
      assetNameRegExp: /\.css$/g,
      cssProcessor: require('cssnano'),
      cssProcessorOptions: {discardComments: {removeAll: true}},
      canPrint: true
    }),
    // js压缩插件
    new webpack.optimize.UglifyJsPlugin({
      mangle: true, // 是否启用代码混淆
      compress: {
        warnings: false
      }
    }),
    // html文件生成插件
    new HtmlWebpackPlugin({
      template: './index.html',
      filename: 'index.html',
      minify: {
        removeComments: true,
        collapseWhitespace: true
      }
    }),
    // 静态资源复杂插件，用于将静态资源复复制到指定目录<commit_msg>修改编译配置-一个样式打包的bug<commit_after>let merge = require('webpack-merge')
let baseConfig = require('./webpack.base.config')
let path = require('path')
let webpack = require('webpack')
let HtmlWebpackPlugin = require('html-webpack-plugin')
let CopyWebpackPlugin = require('copy-webpack-plugin')
let ExtractTextPlugin = require('extract-text-webpack-plugin')
let OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin')
let config = require('./index')
module.exports = merge(baseConfig, {
  output: {
    publicPath: config.prod.publicPath,
    path: path.resolve(__dirname, '../dist'),
    filename: 'static/js/[name].[chunkhash].js',
    chunkFilename: 'static/js/[id].[chunkhash].js'
  },
  module: {
    rules: [{
      test: /\.css$/,
      loader: ExtractTextPlugin.extract({
        fallback: 'style-loader',
        use: 'css-loader'
      })
    }, {
      test: /\.less$/,
      loader: ExtractTextPlugin.extract({
        fallback: 'style-loader',
        use: ['css-loader', 'less-loader']
      })
    }]
  },
  plugins: [
    // 文本拆分插件，单独拆分css文件
    new ExtractTextPlugin({filename: 'static/css/[name].[chunkhash].css'}),
    // css压缩插件
    new OptimizeCssAssetsPlugin({
      assetNameRegExp: /\.css$/g,
      cssProcessor: require('cssnano'),
      cssProcessorOptions: {discardComments: {removeAll: true}},
      canPrint: true
    }),
    // js压缩插件
    new webpack.optimize.UglifyJsPlugin({
      mangle: true, // 是否启用代码混淆
      compress: {
        warnings: false
      }
    }),
    // html文件生成插件
    new HtmlWebpackPlugin({
      template: './index.html',
      filename: 'index.html',
      minify: {
        removeComments: true,
        collapseWhitespace: true
      }
    }),
    // 静态资源复杂插件，用于将静态资源复复制到指定目录
{'fraction_non_alphanumeric': 0.1557614360162131, 'fraction_numerical': 0.0, 'mean_word_length': 2.834628190899001, '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': '7293740', 'n_tokens_mistral': 1196, 'n_tokens_neox': 1213, 'n_words': 195}