<commit_before>const babel = require('gulp-babel');
const ejs = require('gulp-ejs');
const gulp = require('gulp');
const path = require('path');
const plumber = require('gulp-plumber');
const rename = require('gulp-rename');
const sass = require('gulp-sass');
const watch = require('gulp-watch');

const pathBuild = 'build/public';

gulp.task('build', ['build:css', 'build:html', 'build:images', 'build:js']);

gulp.task('build:css', () => {
	return gulp.src('src/public/css/*')
		.pipe(plumber())
		.pipe(sass())
		.pipe(gulp.dest(path.join(pathBuild, 'css')));
});

gulp.task('build:html', () => {
	return gulp.src('src/public/html/*.html')
		// .pipe(ejs({

		// }))
		// .pipe(rename({
		// 	extname: 'html'
		// }))
		.pipe(gulp.dest(path.join(pathBuild, 'html')));
});

gulp.task('build:images', () => {
	return gulp.src('src/public/images/*')
		.pipe(gulp.dest(path.join(pathBuild, 'images')));
});

gulp.task('build:js', () => {
	return gulp.src('src/public/js/**/*.js')
		.pipe(plumber())
		.pipe(babel({
			plugins: ['transform-react-jsx'],
			presets: ['es2015']
		}))
		.pipe(gulp.dest(path.join(pathBuild, 'js')));
});

gulp.task('watch', () => {
	watch('src/**/*', vinyl => {
		//var dirname = path.basename(path.dirname(vinyl.path));

		gulp.start('build');
	});
});<commit_msg>Improve watch task<commit_after>'use strict';

const babel = require('gulp-babel');
const ejs = require('gulp-ejs');
const gulp = require('gulp');
const path = require('path');
const plumber = require('gulp-plumber');
const rename = require('gulp-rename');
const sass = require('gulp-sass');
const watch = require('gulp-watch');

const pathBuild = 'build/public';

gulp.task('build', ['build:css', 'build:html', 'build:images', 'build:js']);

gulp.task('build:css', () => {
	return gulp.src('src/public/css/*')
		.pipe(plumber())
		.pipe(sass())
		.pipe(gulp.dest(path.join(pathBuild, 'css')));
});

gulp.task('build:html', () => {
	return gulp.src('src/public/html/*.html')
		.pipe(gulp.dest(path.join(pathBuild, 'html')));
});

gulp.task('build:images', () => {
	return gulp.src('src/public/images/*')
		.pipe(gulp.dest(path.join(pathBuild, 'images')));
});

gulp.task('build:js', () => {
	return gulp.src('src/public/js/**/*.js')
		.pipe(plumber())
		.pipe(babel({
			plugins: ['transform-react-jsx'],
			presets: ['es2015']
		}))
		.pipe(gulp.dest(path.join(pathBuild, 'js')));
});

gulp.task('watch', () => {
	watch('src/**/*', vinyl => {
		var cwdName = path.basename(process.cwd());

		var regex = new RegExp(path.join(cwdName, 'src/public/') + '(.+?)\\/');

		var subDirName = vinyl.path.match(regex)[1];

		gulp.start(`build:${subDirName}`);
	});
});
{'fraction_non_alphanumeric': 0.2609351432880845, 'fraction_numerical': 0.003393665158371041, 'mean_word_length': 4.705376344086021, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '285286', 'n_tokens_mistral': 1084, 'n_tokens_neox': 1027, 'n_words': 150}