<commit_before>module.exports = function (grunt) {
  // load all grunt tasks matching the `grunt-*` pattern
  require('load-grunt-tasks')(grunt);

  grunt.initConfig({
    config: grunt.file.exists('config.json') ? grunt.file.readJSON('config.json') : {},
    autoprefixer: {
      multiple_files: {
        expand: true,
        cwd: 'build/',
        src: ['**/*.css'],
        dest: 'build/'
      }
    },
    browserify: {
      // vendor: {
      //   src: [],
      //   dest: 'public/vendor.js',
      //   options: {
      //     require: ['jquery'],
      //     alias: ['./lib/moments.js:momentWrapper']
      //   }
      // },
      client: {
        src: ['scripts/client/**/*.js'],
        dest: 'build/assets/main.js'
        // options: {
        //   external: ['jQuery', 'momentWrapper']
        // }
      }
    },
    clean: {
      build: [
        'build'
      ],
      gzip: [
        'build/**/*.gz'
      ]
    },
    compress: {
      main: {
        options: {
          mode: 'gzip'
        },
        files: [
          {expand: true, src: ['build/**/*.css'], dest: '', ext:'.css.gz'},
          {expand: true, src: ['build/**/*.js'], dest: '', ext:'.js.gz'},
          {expand: true, src: ['build/**/*.svg'], dest: '', ext:'.svg.gz'},
          {expand: true, src: ['build/**/*.html'], dest: '', ext:'.html.gz'},
          {expand: true, src: ['build/**/*.json'], dest: '', ext:'.json.gz'},
        ]
      }
    },
    connect: {
      options: {
        base: 'build/',
        hostname: '0.0.0.0'
      },
      devserver: {
        options: {
          port: 8888
        }
      },
      deploytest: {
        options: {
          port: 8888,
          keepalive: true
        }
      }
    },
    copy: {
      js: {
        files: [
          {expand: true, cwd: 'scripts/', src: ['**/*.js', '!client/**/*.js'], dest: 'build/assets/'}
        ]
      },
      assets: {
        files: [
          {expand: true, cwd: 'assets/', src: ['**'], dest: 'build/assets/'},
        ]
      },
      gzip: {
        files: [
          { expand: true, dot: true, cwd: 'build', dest: 'build', src: ['**/*.css.gz'], ext: '.css' },
          { expand: true, dot: true, cwd: 'build', dest: 'build', src: ['**/*.js.gz'], ext: '.js' },
          { expand: true, dot: true, cwd: 'build', dest: 'build', src: ['**/*.svg.gz'], ext: '.svg' },
          { expand: true, dot: true, cwd: 'build', dest: 'build', src: ['**/*.html.gz'], ext: '.html' },
          { expand: true, dot: true, cwd: 'build', dest: 'build', src: ['**/*.json.gz'], ext: '.json' }
        ]
      }
    },
    hashres: {
      options: {
        fileNameFormat: '${name}-${hash}.${ext}',
        renameFiles: true
      },
      css: {
        src: [ 'build/**/*.css' ],
        dest: ['build/**/*.html', 'build/**/*.json']
      },
      js: {
        src: [ 'build/**/*.js' ],
        dest: 'build/**/*.html'
      },
      images: {
        src: [
          'build/**/*.png',
          'build/**/*.jpg',
          'build/**/*.svg',
          'build/**/*.ico'
        ],
        dest: [
          'build/**/*.html',
          'build/**/*.js',
          'build/**/*.css',
          'build/**/*.md',
          'build/**/*.json'
        ]
      }
    },
    htmllint: {
      all: ["build/**/*.html"]
    },
    htmlmin: {
      dist: {<commit_msg>fixed gzip<commit_after>module.exports = function (grunt) {
  // load all grunt tasks matching the `grunt-*` pattern
  require('load-grunt-tasks')(grunt);

  grunt.initConfig({
    config: grunt.file.exists('config.json') ? grunt.file.readJSON('config.json') : {},
    autoprefixer: {
      multiple_files: {
        expand: true,
        cwd: 'build/',
        src: ['**/*.css'],
        dest: 'build/'
      }
    },
    browserify: {
      // vendor: {
      //   src: [],
      //   dest: 'public/vendor.js',
      //   options: {
      //     require: ['jquery'],
      //     alias: ['./lib/moments.js:momentWrapper']
      //   }
      // },
      client: {
        src: ['scripts/client/**/*.js'],
        dest: 'build/assets/main.js'
        // options: {
        //   external: ['jQuery', 'momentWrapper']
        // }
      }
    },
    clean: {
      build: [
        'build'
      ],
      gzip: [
        'build/**/*.gz'
      ]
    },
    compress: {
      main: {
        options: {
          mode: 'gzip'
        },
        files: [
          {
            cwd: 'build',
            expand: true,
            src: ['**/*.css', '**/*.js', '**/*.svg', '**/*.html', '**/*.json'],
            dest: 'build/',
            rename: function(dest, src) {
              return dest + src + '.gz';
            }
          }
        ]
      }
    },
    connect: {
      options: {
        base: 'build/',
        hostname: '0.0.0.0'
      },
      devserver: {
        options: {
          port: 8888
        }
      },
      deploytest: {
        options: {
          port: 8888,
          keepalive: true
        }
      }
    },
    copy: {
      js: {
        files: [
          {expand: true, cwd: 'scripts/', src: ['**/*.js', '!client/**/*.js'], dest: 'build/assets/'}
        ]
      },
      assets: {
        files: [
          {expand: true, cwd: 'assets/', src: ['**'], dest: 'build/assets/'},
        ]
      },
      gzip: {
        files: [
          {
            expand: true,
            dot: true,
            cwd: 'build',
            dest: 'build/',
            src: ['**/*.css.gz', '**/*.js.gz', '**/*.svg.gz', '**/*.html.gz', '**/*.json.gz'],
            rename: function(dest, src) {
              return dest + src.replace(/\.gz/, '');
            }
          }
        ]
      }
    },
    hashres: {
      options: {
        fileNameFormat: '${name}.${hash}.${ext}',
        renameFiles: true
      },
      css: {
        src: [ 'build/**/*.css' ],
        dest: ['build/**/*.html', 'build/**/*.json']
      },
      js: {
        src: [ 'build/**/*.js' ],
        dest: 'build/**/*.html'
      },
      images: {
        src: [
          'build/**/*.png',
          'build/**/*.jpg',
          'build/**/*.svg',
          'build/**/*.ico'
        ],
        dest: [
          'build/**/*.html',
          'build/**/*.js',
          'build/**/*.css',
          'build/**/*.md',
          'build/**/*.json'
        ]
      }
    },
    htmllint: {
      all: ["build/**/*.html"]
    },
    htmlmin: {
      dist: {
{'fraction_non_alphanumeric': 0.22951590161366128, 'fraction_numerical': 0.0037599874667084443, 'mean_word_length': 1.2751247327156094, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '7503436', 'n_tokens_mistral': 2168, 'n_tokens_neox': 2155, 'n_words': 388}