|
1 | | -var gulp = require('gulp'); |
2 | | -var concat = require('gulp-concat'); |
3 | | -var expose = require('gulp-expose'); |
4 | | -var stripLine = require('gulp-strip-line'); |
5 | | -var gulpif = require('gulp-if'); |
6 | | -var del = require('del'); |
7 | | -var rename = require("gulp-rename"); |
8 | | -var jshint = require('gulp-jshint'); |
9 | | -var stylish = require('jshint-stylish'); |
| 1 | +import gulp from 'gulp'; |
| 2 | +import concat from 'gulp-concat'; |
| 3 | +import expose from 'gulp-expose'; |
| 4 | +import stripLine from 'gulp-strip-line'; |
| 5 | +import gulpif from 'gulp-if'; |
| 6 | +import {deleteAsync} from 'del'; |
| 7 | +import jshint from 'gulp-jshint'; |
| 8 | +import stylish from 'jshint-stylish'; |
10 | 9 |
|
11 | | -gulp.task('dist', ['clean'], function() { |
12 | | - gulp.src('src/*.gs') |
| 10 | +gulp.task('clean', () => deleteAsync(['dist/*'])); |
| 11 | + |
| 12 | +gulp.task('lint', () => gulp.src('src/*.gs') |
| 13 | + .pipe(jshint()) |
| 14 | + .pipe(jshint.reporter(stylish)) |
| 15 | +); |
| 16 | + |
| 17 | +gulp.task('dist', gulp.series('clean', 'lint', () => gulp.src('src/*.gs') |
13 | 18 | .pipe(gulpif(/OAuth1\.gs$/, |
14 | 19 | stripLine('var _ ='))) |
15 | 20 | .pipe(concat('OAuth1.gs')) |
16 | 21 | .pipe(expose('this', 'OAuth1')) |
17 | | - .pipe(gulp.dest('dist')); |
18 | | -}); |
| 22 | + .pipe(gulp.dest('dist')) |
| 23 | +)); |
19 | 24 |
|
20 | | -gulp.task('clean', function() { |
21 | | - del([ |
22 | | - 'dist/*' |
23 | | - ]); |
24 | | -}); |
25 | | - |
26 | | -gulp.task('lint', function() { |
27 | | - return gulp.src('src/*.gs') |
28 | | - .pipe(jshint()) |
29 | | - .pipe(jshint.reporter(stylish)); |
30 | | -}); |
0 commit comments