-
Notifications
You must be signed in to change notification settings - Fork 162
/
gulpfile.js
43 lines (38 loc) · 1.29 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const gulp = require('gulp');
const concat = require('gulp-concat');
const uglify = require('gulp-uglify');
const gulpCopy = require('gulp-copy');
const header = require('gulp-header');
const less = require('gulp-less');
const package = require('./package.json');
gulp.task('concat', function () {
return gulp.src(['./src/w5cValidator.js', './src/directive.js'])
.pipe(concat('w5cValidator.js'))
.pipe(header('/*! <%= pkg.name %> v<%= pkg.version %> <%= date %> */\n', {pkg: package, date: new Date()}))
.pipe(gulp.dest('./'))
.pipe(uglify({}))
.pipe(concat('w5cValidator.min.js'))
.pipe(gulp.dest('./'));
});
gulp.task('less', function () {
return gulp.src('./src/style.less')
.pipe(less({
// paths: [path.join(__dirname, 'less', 'includes')]
}))
.pipe(gulp.dest('./'));
});
gulp.task('copy', function () {
return gulp
.src('./src/style.less')
.pipe(gulpCopy('./', {prefix: 1}));
});
gulp.task('example', function () {
return gulp
.src('./example/css/css.less')
.pipe(less({
// paths: [path.join(__dirname, 'less', 'includes')]
}))
.pipe(gulp.dest('./example/css'));
});
gulp.task('default', ['copy', 'less', 'concat']);
gulp.task('build', ['default']);