<commit_before>import path from "path"
import loaderUtils from "loader-utils"
import frontMatterParser from "gray-matter"

import joinUri from "../_utils/join-uri"
import urlify from "../_utils/urlify"
import enhanceCollection from "../enhance-collection"
import feed from "./feed"
import cache from "./cache"
import description from "./description"
import validator from "./validator"

let timeout

module.exports = function(input) {
  const query = loaderUtils.parseQuery(this.query)

  try {
    validator(query)
  }
  catch (err) {
    this.emitError(err)
  }

  const context = query.context || this.options.context
  const renderer = query.renderer || require("./default-renderer").default

  const defaultHead = query.defaultHead
  const parsed = frontMatterParser(input)
<commit_msg>Allow to config loader from webpack option<commit_after>import path from "path"
import loaderUtils from "loader-utils"
import frontMatterParser from "gray-matter"

import joinUri from "../_utils/join-uri"
import urlify from "../_utils/urlify"
import enhanceCollection from "../enhance-collection"
import feed from "./feed"
import cache from "./cache"
import description from "./description"
import validator from "./validator"

let timeout

module.exports = function(input) {
  const query =
    this.options.statinamic
      ? this.options.statinamic.loader
      : loaderUtils.parseQuery(this.query)

  try {
    validator(query)
  }
  catch (err) {
    this.emitError(err)
  }

  const context = query.context || this.options.context
  const renderer = query.renderer || require("./default-renderer").default

  const defaultHead = query.defaultHead
  const parsed = frontMatterParser(input)

{'fraction_non_alphanumeric': 0.11091340450771056, 'fraction_numerical': 0.0, 'mean_word_length': 4.174846625766871, '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': '4010713', 'n_tokens_mistral': 480, 'n_tokens_neox': 477, 'n_words': 140}