<commit_before>// this runs synchronously
require('./copy')

const {join, resolve} = require('path')
const withPlugins = require('next-compose-plugins')
const configure = require('./lib/config')
const css = require('@zeit/next-css')
const sass = require('@zeit/next-sass')

const pageExtensions = ['js', 'jsx', 'md', 'mdx']
const assetPrefix = process.env.NOW_URL

module.exports = withPlugins([
  css(sass({
    sassLoaderOptions: {
      includePaths: [resolve(__dirname, '../modules')]
    }
  })),
  configure()
], {
  /*
   * Note: Prefixing assets with the fully qualified deployment URL
   * makes them available even when the site is served from a path alias, as in
   * <https://primer.style/components>
   */
  assetPrefix: process.env.NOW_URL,
  pageExtensions,
  publicRuntimeConfig: {
    assetPrefix
  },

  webpack(config, {dev}) {
    const {optimization} = config
    if (optimization && Array.isArray(optimization.minimizer)) {
      const terserPlugin = optimization.minimizer[0]
      /* eslint-disable camelcase, no-console */
      console.warn('*** disabling mangling in Terser plugin ***')
      terserPlugin.options.terserOptions = {
        keep_fnames: true
      }
      /* eslint-enable camelcase, no-console */
    }
    return config
  }
})<commit_msg>nix webpack() callback from next.config.js, tidy<commit_after>// this runs synchronously
// require('./copy')

const {join, resolve} = require('path')
const withPlugins = require('next-compose-plugins')
const configure = require('./lib/config')
const css = require('@zeit/next-css')
const sass = require('@zeit/next-sass')

const {NOW_URL} = process.env
const assetPrefix = NOW_URL || ''

module.exports = withPlugins([
  css(sass({
    sassLoaderOptions: {
      includePaths: [
        resolve(__dirname, '../modules')
      ]
    }
  })),
  configure()
], {
  /*
   * Note: Prefixing assets with the fully qualified deployment URL
   * makes them available even when the site is served from a path alias, as in
   * <https://primer.style/css>
   */
  assetPrefix,
  pageExtensions: ['js', 'jsx', 'md', 'mdx'],
  publicRuntimeConfig: {
    assetPrefix
  }
})
{'fraction_non_alphanumeric': 0.1455902939804013, 'fraction_numerical': 0.0004666355576294914, 'mean_word_length': 3.504201680672269, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '308418', 'n_tokens_mistral': 672, 'n_tokens_neox': 659, 'n_words': 169}