<commit_before>const gulp = require('gulp');
const babel = require('gulp-babel');
const watch = require('gulp-watch');

gulp.task('default', ['compileJS', 'moveConfig']);

gulp.task('compileJS', [], function() {
	var babelProcess = babel({presets: ['es2015']})
    babelProcess.on('error', function(e) {
        console.log(e);
        process.exit(1);
    });

    return watch('src/**/*.js', {
        verbose: true,
        ignoreInitial: false
    }).pipe(babelProcess).pipe(gulp.dest('lib'));
})

gulp.task('moveConfig', [], function() {
    return watch('src/config/**/*.*', {
        verbose: true,
        ignoreInitial: false
    }, () => {
        gulp.src('src/config/**/*.*', {base: 'src/'}).pipe(gulp.dest('lib'));
    })
});
<commit_msg>chore: gulp 启动时先清理 lib 目录<commit_after>const fs = require('fs-extra');
const gulp = require('gulp');
const babel = require('gulp-babel');
const watch = require('gulp-watch');

gulp.task('default', ['clearLib', 'compileJS', 'moveConfig']);

gulp.task('clearLib', [], function() {
    return fs.removeSync('./lib/')
});

gulp.task('compileJS', [], function() {
	var babelProcess = babel({presets: ['es2015']})
    babelProcess.on('error', function(e) {
        console.log(e);
        process.exit(1);
    });

    return watch('src/**/*.js', {
        verbose: true,
        ignoreInitial: false
    }).pipe(babelProcess).pipe(gulp.dest('lib'));
})

gulp.task('moveConfig', [], function() {
    return watch('src/config/**/*.*', {
        verbose: true,
        ignoreInitial: false
    }, () => {
        gulp.src('src/config/**/*.*', {base: 'src/'}).pipe(gulp.dest('lib'));
    })
});

{'fraction_non_alphanumeric': 0.23396456933414783, 'fraction_numerical': 0.006108735491753207, 'mean_word_length': 3.356382978723404, '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': '7002539', 'n_tokens_mistral': 567, 'n_tokens_neox': 553, 'n_words': 92}