<commit_before>const OfflinePlugin = require('offline-plugin')

module.exports = options => ({
  entry: 'src/index.js',
  postcss: [
    // add more postcss plugins here
    // by default we have autoprefixer pre added
    require('postcss-nested'),
    require('postcss-property-lookup')
  ],
  webpack(config) {
    // inject offline-plugin in production build
    if (!options.dev) {
      config.plugins.push(new OfflinePlugin({
        caches: {
          main: [':rest:']
          // additional: [':externals:'],
        },
        ServiceWorker: {
          events: true
        },
        AppCache: {
          events: true
        }
      }))
    }

    config.node = {
      fs: 'empty'
    }

    return config
  },
  production: {
    sourceMap: false
  }
})<commit_msg>optimize offline cache<commit_after>const OfflinePlugin = require('offline-plugin')

module.exports = options => ({
  entry: 'src/index.js',
  postcss: [
    // add more postcss plugins here
    // by default we have autoprefixer pre added
    require('postcss-nested'),
    require('postcss-property-lookup')
  ],
  webpack(config) {
    // inject offline-plugin in production build
    if (!options.dev) {
      config.plugins.push(new OfflinePlugin({
        safeToUseOptionalCaches: true,
        caches: {
          main: [':rest:'],
          optional: ['*.chunk.js'],
          additional: ['static/*', 'favicon-*.png', 'favicon.ico']
        },
        ServiceWorker: {
          events: true
        },
        AppCache: {
          events: true,
          caches: ['main', 'additional', 'optional']
        }
      }))
    }

    config.node = {
      fs: 'empty'
    }

    return config
  },
  production: {
    sourceMap: false
  }
})
{'fraction_non_alphanumeric': 0.14046242774566475, 'fraction_numerical': 0.0, 'mean_word_length': 2.0262237762237763, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '573583', 'n_tokens_mistral': 531, 'n_tokens_neox': 517, 'n_words': 114}