<commit_before>let glob = require('glob');

class PurifyCss {
    constructor() {
        this.passive = true;
    }

    dependencies() {
        this.requiresReload = true;

        return ['purifycss-webpack', 'purify-css'];
    }

    boot() {
        if (Config.purifyCss) {
            Config.purifyCss = this.build(Config.purifyCss);
        }
    }

    webpackPlugins() {
        if (Config.purifyCss) {
            let CssPurifierPlugin = require('../webpackPlugins/CssPurifierPlugin');

            return CssPurifierPlugin.build();
        }
    }

    build(options) {
        if (typeof options === 'object' && options.paths) {
            let paths = options.paths;

            paths.forEach(path => {
                if (!path.includes('*')) return;

                options.paths.splice(paths.indexOf(path), 1);

                options.paths = paths.concat(glob.sync(path));
            });
        }

        return options;
    }
}

module.exports = PurifyCss;
<commit_msg>Only fetch dependencies if needed<commit_after>let glob = require('glob');

class PurifyCss {
    constructor() {
        this.passive = true;
    }

    dependencies() {
        if (Config.purifyCss) {
            this.requiresReload = true;

            return ['purifycss-webpack', 'purify-css'];
        }
    }

    boot() {
        if (Config.purifyCss) {
            Config.purifyCss = this.build(Config.purifyCss);
        }
    }

    webpackPlugins() {
        if (Config.purifyCss) {
            let CssPurifierPlugin = require('../webpackPlugins/CssPurifierPlugin');

            return CssPurifierPlugin.build();
        }
    }

    build(options) {
        if (typeof options === 'object' && options.paths) {
            let paths = options.paths;

            paths.forEach(path => {
                if (!path.includes('*')) return;

                options.paths.splice(paths.indexOf(path), 1);

                options.paths = paths.concat(glob.sync(path));
            });
        }

        return options;
    }
}

module.exports = PurifyCss;

{'fraction_non_alphanumeric': 0.1316812439261419, 'fraction_numerical': 0.0009718172983479105, 'mean_word_length': 1.760053619302949, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1179234', 'n_tokens_mistral': 636, 'n_tokens_neox': 597, 'n_words': 102}