<commit_before>require('dotenv').config()

const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
const webpack = require('webpack')
const { ANALYZE } = process.env
const isProd = process.NODE_ENV === 'production'

module.exports = {
  assetPrefix: isProd? 'https://static.bonde.org' : '',
  webpack: (config, { dev }) => {
    if (ANALYZE) {
      config.plugins.push(new BundleAnalyzerPlugin({
        analyzerMode: 'server',
        analyzerPort: 8888,
        openAnalyzer: true
      }))
    }

    config.plugins.push(new webpack.EnvironmentPlugin({
      API_URL: JSON.stringify(process.env.API_URL),
      GRAPHQL_URL: JSON.stringify(process.env.GRAPHQL_URL),
      APP_DOMAIN: JSON.stringify(process.env.APP_DOMAIN)
    }))

    config.plugins.push(new webpack.ProvidePlugin({
      'window.jQuery': 'jquery'
    }))

    config.module.rules.push(
      {
        test: /\.js$/,
        loader: 'babel-loader',
        exclude: /(node_modules|wysihtml-toolbar.min)/
      },
      {
        test: /\.css$/,
        use: [{
          loader: 'css-loader',
          options: {
            importLoaders: 1
          }
        }]
      },
      {
        test: /\.(png|jpg)$/,
        use: [{
          loader: 'file-loader',
          options: {
            limit: 10000, // Convert images < 10k to base64 strings
            name: 'static/images/[name].[ext]'
          }
        }]
      }
    )
    return config
  }
}
<commit_msg>chore(devops): Add to webpack publicpath default cdn when production<commit_after>require('dotenv').config()

const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
const webpack = require('webpack')
const { ANALYZE, APP_DOMAIN, NODE_ENV } = process.env
const isProd = NODE_ENV === 'production'

module.exports = {
  assetPrefix: isProd ? `https://static.${APP_DOMAIN}` : '',
  webpack: (config, { dev }) => {
    config.output.publicPath = isProd ? `https://static.${APP_DOMAIN}${config.output.publicPath}` : config.output.publicPath;

    if (ANALYZE) {
      config.plugins.push(new BundleAnalyzerPlugin({
        analyzerMode: 'server',
        analyzerPort: 8888,
        openAnalyzer: true
      }))
    }

    config.plugins.push(new webpack.EnvironmentPlugin({
      API_URL: JSON.stringify(process.env.API_URL),
      GRAPHQL_URL: JSON.stringify(process.env.GRAPHQL_URL),
      APP_DOMAIN: JSON.stringify(process.env.APP_DOMAIN)
    }))

    config.plugins.push(new webpack.ProvidePlugin({
      'window.jQuery': 'jquery'
    }))

    config.module.rules.push(
      {
        test: /\.js$/,
        loader: 'babel-loader',
        exclude: /(node_modules|wysihtml-toolbar.min)/
      },
      {
        test: /\.css$/,
        use: [{
          loader: 'css-loader',
          options: {
            importLoaders: 1
          }
        }]
      },
      {
        test: /\.(png|jpg)$/,
        use: [{
          loader: 'file-loader',
          options: {
            limit: 10000, // Convert images < 10k to base64 strings
            name: 'static/images/[name].[ext]'
          }
        }]
      }
    )
    return config
  }
}

{'fraction_non_alphanumeric': 0.1485053037608486, 'fraction_numerical': 0.00900032144005143, 'mean_word_length': 2.1213640922768304, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 3, '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': '7572017', 'n_tokens_mistral': 1047, 'n_tokens_neox': 978, 'n_words': 166}