<commit_before>/* global hexo */

var isEnabled = process.env.NODE_ENV !== 'development' &&
  (hexo.config.hasOwnProperty('all_minifier') === false || hexo.config.all_minifier === true);

if (isEnabled) {
  // HTML minifier
  hexo.config.html_minifier = Object.assign({
    enable: true,
    exclude: [],
    ignoreCustomComments: [/^\s*more/],
    removeComments: true,
    removeCommentsFromCDATA: true,
    collapseWhitespace: true,
    collapseBooleanAttributes: true,
    removeEmptyAttributes: true,
    minifyJS: true,
    minifyCSS: true
  }, hexo.config.html_minifier);

  // Css minifier
  hexo.config.css_minifier = Object.assign({
    enable: true,
    exclude: ['*.min.css']
  }, hexo.config.css_minifier);

  // Js minifier
  hexo.config.js_minifier = Object.assign({
    enable: true,
    mangle: true,
    output: {},
    compress: {},
    exclude: ['*.min.js']
  }, hexo.config.js_minifier, {
    fromString: true
  });

  // Image minifier
  hexo.config.image_minifier = Object.assign({
    enable: true,
    interlaced: false,
    multipass: false,
    optimizationLevel: 3,
    pngquant: false,
    progressive: false
  }, hexo.config.image_minifier);

  hexo.extend.filter.register('after_render:html', require('./lib/optimizeHTML'));

  hexo.extend.filter.register('after_render:css', require('./lib/optimizeCSS'));

  hexo.extend.filter.register('after_render:js', require('./lib/optimizeJS'));

  hexo.extend.filter.register('after_generate', require('./lib/optimizeImage'));
}<commit_msg>fix: remove the fromstring option<commit_after>/* global hexo */

var isEnabled = process.env.NODE_ENV !== 'development' &&
  (hexo.config.hasOwnProperty('all_minifier') === false || hexo.config.all_minifier === true);

if (isEnabled) {
  // HTML minifier
  hexo.config.html_minifier = Object.assign({
    enable: true,
    exclude: [],
    ignoreCustomComments: [/^\s*more/],
    removeComments: true,
    removeCommentsFromCDATA: true,
    collapseWhitespace: true,
    collapseBooleanAttributes: true,
    removeEmptyAttributes: true,
    minifyJS: true,
    minifyCSS: true
  }, hexo.config.html_minifier);

  // Css minifier
  hexo.config.css_minifier = Object.assign({
    enable: true,
    exclude: ['*.min.css']
  }, hexo.config.css_minifier);

  // Js minifier
  hexo.config.js_minifier = Object.assign({
    enable: true,
    mangle: true,
    output: {},
    compress: {},
    exclude: ['*.min.js']
  }, hexo.config.js_minifier);

  // Image minifier
  hexo.config.image_minifier = Object.assign({
    enable: true,
    interlaced: false,
    multipass: false,
    optimizationLevel: 3,
    pngquant: false,
    progressive: false
  }, hexo.config.image_minifier);

  hexo.extend.filter.register('after_render:html', require('./lib/optimizeHTML'));

  hexo.extend.filter.register('after_render:css', require('./lib/optimizeCSS'));

  hexo.extend.filter.register('after_render:js', require('./lib/optimizeJS'));

  hexo.extend.filter.register('after_generate', require('./lib/optimizeImage'));
}
{'fraction_non_alphanumeric': 0.15540092776673295, 'fraction_numerical': 0.0006626905235255136, 'mean_word_length': 3.769352290679305, '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': '1604416', 'n_tokens_mistral': 1009, 'n_tokens_neox': 987, 'n_words': 174}