<commit_before>/**
 * Contains addCompileResult that decides 
 * how current compiled styles should be exposed outside:
 * whether they will be just bundled together with other styles,
 * or will be available as static assets on the server as well.
 */
BasicCompiler = class BasicCompiler {
  addCompileResult(inputFile, result) {
    const ext = inputFile.getExtension();
    const sourcePath = inputFile.getPathInPackage();
    const targetPath = ext !== 'css' ? sourcePath + '.css' : sourcePath;
 
    // Combine all styles from other than imports folders.
    if (sourcePath.indexOf('imports') === -1) {
      inputFile.addStylesheet({
        data: result.css,
        path: targetPath,
        sourceMap: result.sourceMap
      });
      return;
    }

    let resultCss = result.css;
    if (! Meteor.isDevelopment) {
      resultCss = CssTools.minifyCss(resultCss)[0];
    }

    // CSS files that comes from `imports` folder
    // can be downloaded as server assets.
    inputFile.addAsset({
      data: resultCss || '',
      path: sourcePath
    });

    if (this.customAddCompileResult) {
      this.customAddCompileResult(inputFile, result);
    }
  }
};
<commit_msg>fix(css-coilers): skip processing files from node_modules.<commit_after>const IMPORTS_REGEXP = /imports(\\|\/)/;
const NPM_REGEXP = /node_modules(\\|\/)/;

/**
 * Contains addCompileResult that decides 
 * how current compiled styles should be exposed outside:
 * whether they will be just bundled together with other styles,
 * or will be available as static assets on the server as well.
 */
BasicCompiler = class BasicCompiler {
  addCompileResult(inputFile, result) {
    const ext = inputFile.getExtension();
    const sourcePath = inputFile.getPathInPackage();
    const targetPath = ext !== 'css' ? sourcePath + '.css' : sourcePath;

    // Skip files from node_modules.
    if (NPM_REGEXP.test(sourcePath)) return;
 
    // Combine all styles from other than imports folders.
    if (! IMPORTS_REGEXP.test(sourcePath)) {
      inputFile.addStylesheet({
        data: result.css,
        path: targetPath,
        sourceMap: result.sourceMap
      });
      return;
    }

    let resultCss = result.css;
    if (! Meteor.isDevelopment) {
      resultCss = CssTools.minifyCss(resultCss)[0];
    }

    // CSS files that comes from `imports` folder
    // can be downloaded as server assets.
    inputFile.addAsset({
      data: resultCss || '',
      path: sourcePath
    });

    if (this.customAddCompileResult) {
      this.customAddCompileResult(inputFile, result);
    }
  }
};

{'fraction_non_alphanumeric': 0.10774017891870867, 'fraction_numerical': 0.0011668611435239206, 'mean_word_length': 2.956923076923077, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6887247', 'n_tokens_mistral': 771, 'n_tokens_neox': 733, 'n_words': 218}