<commit_before>// gulp/tasks/build/css.js
'use strict';

// ----------------------------------
// available tasks: 
//    'gulp build:css' : main css task
// ----------------------------------
// plugins:
//     gulp-sourcemaps        : $.sourcemaps
//     gulp-minify-css        : $.minifyCss
//     gulp-rename            : $.rename
//     gulp-plumber           : $.plumber
//     gulp-concat            : $.concat
//     gulp-uncss             : $.uncss
//     gulp-filter            : $.filter
//     gulp-cssbeautify       : $.cssbeautify
//     gulp-strip-css-comments: $.stripCssComments
// ----------------------------------
// config:
//     config.task.build : task name
// ----------------------------------

module.exports = function(gulp, $, path, config) {

    // avoid writing sourcemaps of sourcemaps
    var filter = $.filter(['*.css', '!*.map'], {
        restore: true
    });

    // start css task
    gulp.task(config.task.build + ':css', function() {

        return gulp.src([
                path.to.sass.dist.dev + '/vendor/*.css',
                path.to.sass.dist.dev + '/*.css',
                '!' + path.to.sass.dist.dev + '/**/_*{,/**}/'
            ])
            // prevent breaking errors
            .pipe($.plumber({
                errorHandler: config.error
            }))
            // remove unused css selectors
            .pipe($.uncss({
                html: [path.to.dist.dev + '*.html'],
                // more options
                // https://github.com/giakki/uncss#within-nodejs
            }))
            // strip unimportant css comments
            .pipe($.stripCssComments({
                preserve: true
            }))
            // beautify final css code
            .pipe($.cssbeautify({
                indent: '  '
            }))
            // initialize sourcemaps
            .pipe($.sourcemaps.init())
            // concat all css files
            .pipe($.concat('style.css'))
            // writing sourcemaps
            .pipe($.sourcemaps.write('.'))
            // dest unminified file
            .pipe(gulp.dest(path.to.sass.dist.prod))
            // filter css files
            .pipe(filter)
            // initialize sourcemaps before minify
            .pipe($.sourcemaps.init())
            // minify
            .pipe($.minifyCss({
                keepSpecialComments: 1
            }))
            // rename files
            .pipe($.rename({
                suffix: '.min'
            }))
            // writing sourcemaps for minified file
            .pipe($.sourcemaps.write('.'))
            // restoring filtered files
            .pipe(filter.restore)
            .pipe(gulp.dest(path.to.sass.dist.prod));

    });

};<commit_msg>add sourcemaps folder<commit_after>// gulp/tasks/build/css.js
'use strict';

// ----------------------------------
// available tasks: 
//    'gulp build:css' : main css task
// ----------------------------------
// plugins:
//     gulp-sourcemaps        : $.sourcemaps
//     gulp-minify-css        : $.minifyCss
//     gulp-rename            : $.rename
//     gulp-plumber           : $.plumber
//     gulp-concat            : $.concat
//     gulp-uncss             : $.uncss
//     gulp-filter            : $.filter
//     gulp-cssbeautify       : $.cssbeautify
//     gulp-strip-css-comments: $.stripCssComments
// ----------------------------------
// config:
//     config.task.build : task name
// ----------------------------------

module.exports = function(gulp, $, path, config) {

    // avoid writing sourcemaps of sourcemaps
    var filter = $.filter(['*.css', '!*.map'], {
        restore: true
    });

    // start css task
    gulp.task(config.task.build + ':css', function() {

        return gulp.src([
                path.to.sass.dist.dev + '/vendor/*.css',
                path.to.sass.dist.dev + '/*.css',
                '!' + path.to.sass.dist.dev + '/**/_*{,/**}/'
            ])
            // prevent breaking errors
            .pipe($.plumber({
                errorHandler: config.error
            }))
            // remove unused css selectors
            .pipe($.uncss({
                html: [path.to.dist.dev + '*.html'],
                // more options
                // https://github.com/giakki/uncss#within-nodejs
            }))
            // strip unimportant css comments
            .pipe($.stripCssComments({
                preserve: true
            }))
            // beautify final css code
            .pipe($.cssbeautify({
                indent: '  '
            }))
            // initialize sourcemaps
            .pipe($.sourcemaps.init())
            // concat all css files
            .pipe($.concat('style.css'))
            // writing sourcemaps
            .pipe($.sourcemaps.write('./maps'))
            // dest unminified file
            .pipe(gulp.dest(path.to.sass.dist.prod))
            // filter css files
            .pipe(filter)
            // initialize sourcemaps before minify
            .pipe($.sourcemaps.init())
            // minify
            .pipe($.minifyCss({
                keepSpecialComments: 1
            }))
            // rename files
            .pipe($.rename({
                suffix: '.min'
            }))
            // writing sourcemaps for minified file
            .pipe($.sourcemaps.write('./maps'))
            // restoring filtered files
            .pipe(filter.restore)
            .pipe(gulp.dest(path.to.sass.dist.prod));

    });

};
{'fraction_non_alphanumeric': 0.19357195032870708, 'fraction_numerical': 0.0003652300949598247, 'mean_word_length': 1.0896604349484929, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '2723395', 'n_tokens_mistral': 1510, 'n_tokens_neox': 1459, 'n_words': 274}