<commit_before>import path from 'path';
import notify from 'gulp-notify';
import plumber from 'gulp-plumber';
import sourcemaps from 'gulp-sourcemaps';
import browserSync from 'browser-sync';

// PostCSS and plugins
import postcss from 'gulp-postcss';
import postcssImport from 'postcss-import';
import postcssCopy from 'postcss-copy';

/**
 * Gulp task to process the css files usign PostCSS and cssnext
 * @param  {object} config Global configuration
 * @return {function}       Function task
 */
export default function postcssTask(userConfig) {
    const gulp = this.gulp;
    const config = userConfig || this.config;
    const plumberOptions = {};
    if (config.notify.onError) {
        plumberOptions.errorHandler = notify.onError('PostCSS Error: <%= error.message %>');
    }

    // PostCSS plugins configuration
    let plugins = config.postcssPlugins.before || [];
    plugins.push(postcssImport());
    plugins.push(postcssCopy({
        src: config.sourcePath,
        dest: config.destPath,
        keepRelativePath: false,
        template: 'assets/[hash].[ext]'
    }));
    if (config.postcssPlugins.after) {
        plugins = plugins.concat(config.postcssPlugins.after);
    }

    return () => {
        let stream = gulp.src(path.join(config.sourcePath, config.entryCss))
            .pipe(plumber(plumberOptions))
            .pipe(postcss(plugins, {
                map: !(config.isProduction),
                to: path.join(config.destPath, config.entryCss)<commit_msg>add node_modules to the postcss-copy multiple src<commit_after>import path from 'path';
import notify from 'gulp-notify';
import plumber from 'gulp-plumber';
import sourcemaps from 'gulp-sourcemaps';
import browserSync from 'browser-sync';

// PostCSS and plugins
import postcss from 'gulp-postcss';
import postcssImport from 'postcss-import';
import postcssCopy from 'postcss-copy';

/**
 * Gulp task to process the css files usign PostCSS and cssnext
 * @param  {object} config Global configuration
 * @return {function}       Function task
 */
export default function postcssTask(userConfig) {
    const gulp = this.gulp;
    const config = userConfig || this.config;
    const plumberOptions = {};
    if (config.notify.onError) {
        plumberOptions.errorHandler = notify.onError('PostCSS Error: <%= error.message %>');
    }

    // PostCSS plugins configuration
    let plugins = config.postcssPlugins.before || [];
    plugins.push(postcssImport());
    plugins.push(postcssCopy({
        src: [config.sourcePath, path.join(config.basePath, 'node_modules')],
        dest: config.destPath,
        keepRelativePath: false,
        template: 'assets/[hash].[ext]'
    }));
    if (config.postcssPlugins.after) {
        plugins = plugins.concat(config.postcssPlugins.after);
    }

    return () => {
        let stream = gulp.src(path.join(config.sourcePath, config.entryCss))
            .pipe(plumber(plumberOptions))
            .pipe(postcss(plugins, {
                map: !(config.isProduction),
                to: path.join(config.destPath, config.entryCss)
{'fraction_non_alphanumeric': 0.11954397394136808, 'fraction_numerical': 0.0, 'mean_word_length': 3.2300275482093666, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '74377', 'n_tokens_mistral': 900, 'n_tokens_neox': 880, 'n_words': 219}