diff options
author | Minteck <contact@minteck.org> | 2021-12-21 16:52:28 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2021-12-21 16:52:28 +0100 |
commit | 46e43f4bde4a35785b4997b81e86cd19f046b69b (patch) | |
tree | c53c2f826f777f9d6b2d249dab556feb72a6c3a6 /src/node_modules/chance/gulpfile.js | |
download | langdetect-46e43f4bde4a35785b4997b81e86cd19f046b69b.tar.gz langdetect-46e43f4bde4a35785b4997b81e86cd19f046b69b.tar.bz2 langdetect-46e43f4bde4a35785b4997b81e86cd19f046b69b.zip |
Commit
Diffstat (limited to 'src/node_modules/chance/gulpfile.js')
-rw-r--r-- | src/node_modules/chance/gulpfile.js | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/node_modules/chance/gulpfile.js b/src/node_modules/chance/gulpfile.js new file mode 100644 index 0000000..2095126 --- /dev/null +++ b/src/node_modules/chance/gulpfile.js @@ -0,0 +1,49 @@ +const gulp = require('gulp') +const ava = require('gulp-ava') +const eslint = require('gulp-eslint') +const rename = require('gulp-rename') +const sourcemaps = require('gulp-sourcemaps') +const uglify = require('gulp-uglify') +const pump = require('pump') + +gulp.task('lint', () => gulp.src(['**/*.js', '!docs/**', '!node_modules/**', '!dist/**', '!test/helpers/**/*.js']) + .pipe(eslint({ + parser: 'babel-eslint', + rules: { + // quotes: ['error', 'single'], + 'curly': 'error', + 'eqeqeq': 'error', + 'new-parens': 'error', + 'no-cond-assign': 'error', + 'no-console': 'error', + 'no-debugger': 'error', + 'no-empty': 'error', + 'no-fallthrough': 'error', + 'no-trailing-spaces': 'error', + 'no-mixed-spaces-and-tabs': 'error', + } + })) + .pipe(eslint.format()) + .pipe(eslint.failAfterError())) + +gulp.task('test', () => gulp.src('test/**/*.js') + .pipe(ava({ verbose: true }))) + +gulp.task('watch', () => { + gulp.watch(['chance.js', 'gulpfile.js', 'test/**/*.js'], ['lint', 'test']) +}) + +gulp.task('watch-lint', () => { + gulp.watch(['chance.js', 'gulpfile.js', 'test/**/*.js'], ['lint']) +}) + +gulp.task('build', (cb) => { + pump([ gulp.src('chance.js'), sourcemaps.init(), + rename('chance.min.js'), uglify(), sourcemaps.write('.'), + gulp.dest('dist'), + ], cb) +}) + +gulp.task('travis', gulp.series('lint', 'test')) + +gulp.task('default', gulp.series('watch', 'lint', 'test')) |