<commit_before>var gulp = require('gulp');
var pug = require('gulp-pug');
var uglifyjs = require('gulp-uglify');
var webpack = require('webpack-stream');
var rename = require('gulp-rename');
var argv = require('yargs').argv;
var newer = require('gulp-newer');
var named = require('vinyl-named-with-path');
var through = require('through');
var path = require('path');
var plumber = require('gulp-plumber');

/*
parameter
*/
// production mode will do minify and so on
var isProduction = (argv.p === undefined) ? false : true;
if( isProduction )
	console.log('production mode detected');

/*
task
*/
// javascript bundling task
// let webpack do his 'watch' job
gulp.task('bundling', function() {
    var src = 'view/src/**/bundle.js';
    var dest = 'view';

    var stream = gulp.src(src)
            .pipe(plumber())
            .pipe(named())
            .pipe(webpack({
                watch: true,
                context: __dirname + '/view', // file loader가 view를 [path]로 인식해버려서..
                module: {
                    loaders: [
                        {test: /\.(scss|sass|css)$/, loader: 'style!css!sass'},
                        {test: /\.vue$/, loader: 'vue'},
                        {test: /\.(png|eot|woff2|woff|ttf|svg)/, loader: 'file?name=[path][name].[ext]&publicPath=/'}
                    ]
                }
            }))
            .pipe(rename(function(file) {
                file.basename = 'bundle';
            }));
    if( isProduction )
        stream.pipe(uglifyjs({mangle: {toplevel: true}}));
    return stream.pipe(gulp.dest(dest));
});

// convert pug to html
gulp.task('pug', function() {
    var src = 'view/src/**/*.pug';
    var dest = 'view';

	return gulp.src(src)
            .pipe(plumber())
            .pipe(named())
			.pipe(pug({locals: {LANTERN_TITLE: 'LANTERN'}}))
			.pipe(gulp.dest(dest));
});

gulp.task('watch', function() {
	gulp.watch('view/src/**/*.pug', ['pug']);
});

gulp.task('default', ['watch', 'bundling', 'pug']);<commit_msg>*del no more pug task on watch<commit_after>var gulp = require('gulp');
var pug = require('gulp-pug');
var uglifyjs = require('gulp-uglify');
var webpack = require('webpack-stream');
var rename = require('gulp-rename');
var argv = require('yargs').argv;
var newer = require('gulp-newer');
var named = require('vinyl-named-with-path');
var through = require('through');
var path = require('path');
var plumber = require('gulp-plumber');

/*
parameter
*/
// production mode will do minify and so on
var isProduction = (argv.p === undefined) ? false : true;
if( isProduction )
	console.log('production mode detected');

/*
task
*/
// javascript bundling task
// let webpack do his 'watch' job
gulp.task('bundling', function() {
    var src = 'view/src/**/bundle.js';
    var dest = 'view';

    var stream = gulp.src(src)
            .pipe(plumber())
            .pipe(named())
            .pipe(webpack({
                watch: true,
                context: __dirname + '/view', // file loader가 view를 [path]로 인식해버려서..
                module: {
                    loaders: [
                        {test: /\.(scss|sass|css)$/, loader: 'style!css!sass'},
                        {test: /\.vue$/, loader: 'vue'},
                        {test: /\.(png|eot|woff2|woff|ttf|svg)/, loader: 'file?name=[path][name].[ext]&publicPath=/'}
                    ]
                }
            }))
            .pipe(rename(function(file) {
                file.basename = 'bundle';
            }));
    if( isProduction )
        stream.pipe(uglifyjs({mangle: {toplevel: true}}));
    return stream.pipe(gulp.dest(dest));
});

// convert pug to html
gulp.task('pug', function() {
    var src = 'view/src/**/*.pug';
    var dest = 'view';

	return gulp.src(src)
            .pipe(plumber())
            .pipe(named())
			.pipe(pug({locals: {LANTERN_TITLE: 'LANTERN'}}))
			.pipe(gulp.dest(dest));
});

gulp.task('watch', function() {
	gulp.watch('view/src/**/*.pug', ['pug']);
});

gulp.task('default', ['watch', 'bundling']);
{'fraction_non_alphanumeric': 0.19083208769307425, 'fraction_numerical': 0.0004982561036372695, 'mean_word_length': 2.3347176079734218, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5027281', 'n_tokens_mistral': 1357, 'n_tokens_neox': 1314, 'n_words': 282}