<commit_before>{resolve} = require('path')
compilers = require('./compilers')
{toArray}    = require('./utils')

class CssBundler
  constructor: (files) ->
    @files = toArray(files).map(resolve).map(require.resolve)

  compile: ->
    @files.map(require).join('')
  
  createServer: ->
    console.log('building server')
    (req, res, next) =>
      content = @compile()
      res.writeHead(200, 'Content-Type': 'text/css')
      res.end(content)
      
module.exports =
  CssBundler: CssBundler
  createPackage: (paths) ->
    new CssBundler(paths)<commit_msg>adding rerequire to the css bundler to rerequire files and prevent caching of files<commit_after>{resolve} = require('path')
compilers = require('./compilers')
{toArray}    = require('./utils')

class CssBundler
  constructor: (files) ->
    @files = toArray(files).map(resolve).map(require.resolve)

  compile: ->
    @files.map(@rerequire).join('')

  createServer: ->
    (req, res, next) =>
      content = @compile()
      res.writeHead(200, 'Content-Type': 'text/css')
      res.end(content)

  rerequire: (file) ->
    delete require.cache[file]
    require(file)
      
module.exports =
  CssBundler: CssBundler
  createPackage: (paths) ->
    new CssBundler(paths)
{'fraction_non_alphanumeric': 0.16006467259498788, 'fraction_numerical': 0.004850444624090542, 'mean_word_length': 3.5182481751824817, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, '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': '884274', 'n_tokens_mistral': 422, 'n_tokens_neox': 407, 'n_words': 81}