<commit_before>module.exports = function(config, lessConfig, pathConfig) {
  'use strict';
  var resolve = require('path').resolve;

  var file = {};
  if(pathConfig.plugin) {
    file[pathConfig.buildTarget+'/plugin.css'] = pathConfig.sourceDir + '/styles.less';
  } else {
    file[pathConfig.buildTarget+'/styles/styles.css'] = pathConfig.sourceDir + '/styles/styles.less';
  }
  if (pathConfig.appName === 'cockpit' && !pathConfig.plugin) {
    file[pathConfig.buildTarget+'/styles/styles-components.css'] = pathConfig.sourceDir + '/styles/styles-components.less';
  }

  var eePrefix = config.pkg.name === 'camunda-bpm-webapp-ee' ? 'node_modules/camunda-bpm-webapp/' : '';
  var includePaths = [
    resolve(process.cwd(), '<%= pkg.gruntConfig.commonsUiDir %>/lib/widgets'),
    resolve(process.cwd(), '<%= pkg.gruntConfig.commonsUiDir %>/resources/less'),
    resolve(process.cwd(), '<%= pkg.gruntConfig.commonsUiDir %>/resources/css'),
    resolve(process.cwd(), '<%= pkg.gruntConfig.commonsUiDir %>/node_modules'),

    resolve(process.cwd(), eePrefix + 'ui/common/styles'),
    resolve(process.cwd(), eePrefix + 'ui/' + pathConfig.appName, 'client/styles'),
    resolve(process.cwd(), eePrefix + 'ui/' + pathConfig.appName, 'client/scripts')
  ];

  lessConfig[pathConfig.appName + (pathConfig.plugin ? '_plugin' : '') + '_styles'] = {
    options: {
      paths: includePaths,

      dumpLineNumbers: '<%= buildMode === "prod" ? "" : "comments" %>',
      compress: '<%= buildMode === "prod" ? "true" : "" %>',
      sourceMap: '<%= buildMode === "prod" ? "true" : "" %>',

      sourceMapURL: './styles.css.map',
      sourceMapFilename: pathConfig.plugin ? pathConfig.buildTarget+'/plugin.css.map' : pathConfig.buildTarget + '/styles/styles.css.map'
    },
    files: file
  };

};<commit_msg>feat(less-build): add source map generation to less task<commit_after>module.exports = function(config, lessConfig, pathConfig) {
  'use strict';
  var path = require('path');

  var file = {};
  if(pathConfig.plugin) {
    file[pathConfig.buildTarget+'/plugin.css'] = pathConfig.sourceDir + '/styles.less';
  } else {
    file[pathConfig.buildTarget+'/styles/styles.css'] = pathConfig.sourceDir + '/styles/styles.less';
  }

  var ee = config.pkg.name === 'camunda-bpm-webapp-ee';
  var eePrefix = ee ? 'node_modules/camunda-bpm-webapp/' : '';
  var includePaths = [
    '<%= pkg.gruntConfig.commonsUiDir %>/lib/widgets',
    '<%= pkg.gruntConfig.commonsUiDir %>/resources/less',
    '<%= pkg.gruntConfig.commonsUiDir %>/resources/css',
    '<%= pkg.gruntConfig.commonsUiDir %>/node_modules',
    eePrefix + 'ui/common/styles',
    eePrefix + 'ui/' + pathConfig.appName + '/client/styles',
    eePrefix + 'ui/' + pathConfig.appName + '/client/scripts'
  ];

  var outputFilepath = Object.keys(file)[0];

  lessConfig[pathConfig.appName + (pathConfig.plugin ? '_plugin' : '') + '_styles'] = {
    options: {
      paths: includePaths,

      compress: true,

      sourceMap: true,
      sourceMapFilename: (pathConfig.plugin ? 'plugin' : 'styles') + '.css.map',
      sourceMapURL: (pathConfig.plugin ? 'plugin' : 'styles') + '.css.map',
      sourceMapFileInline: false
    },
    files: file
  };

  if (pathConfig.appName === 'cockpit' && !pathConfig.plugin) {
    file = {};
    outputFilepath = pathConfig.buildTarget + '/styles/styles-components.css';
    file[outputFilepath] = pathConfig.sourceDir + '/styles/styles-components.less';

    lessConfig.cockpit_styles_components = {
      options: {
        paths: includePaths,

        compress: true,

        sourceMap: true,
        sourceMapFilename: 'styles-components.css.map',
        sourceMapURL: './styles-components.css.map',
        sourceMapFileInline: false
      },
      files: file
    };
  }
};
{'fraction_non_alphanumeric': 0.17880794701986755, 'fraction_numerical': 0.00026490066225165563, 'mean_word_length': 3.5825242718446604, 'pattern_counts': {'":': 0, '<': 14, '<?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': '1657397', 'n_tokens_mistral': 1247, 'n_tokens_neox': 1211, 'n_words': 195}