-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
46 lines (37 loc) · 1.3 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
44
45
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var htmlmin = require('gulp-htmlmin');
gulp.task('default', function() {
// place code for your default task here
});
gulp.task('build', ['minify', 'nodejs']);
gulp.task('publish', ['build', 'icons', 'locale']);
gulp.task('icons', function() {
return gulp.src('src/icons/**/*').pipe(gulp.dest('modbus-rtu/icons'));
});
gulp.task('locale', function() {
return gulp.src('src/locales/**/*').pipe(gulp.dest('modbus-rtu/locales'));
});
gulp.task('minify', function () {
return gulp.src('src/*.html')
.pipe(htmlmin({
minifyJS: true, minifyCSS: true, minifyURLs: true,
maxLineLength: 120, preserveLineBreaks: false,
collapseWhitespace: true, collapseInlineTagWhitespace: true, conservativeCollapse: true,
processScripts:["text/x-red"], quoteCharacter: "'"
}))
.pipe(gulp.dest('modbus-rtu'))
});
gulp.task('nodejs', function () {
return gulp.src('src/*.js')
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'))
.pipe(gulp.dest('modbus-rtu'));
});
gulp.task('lint', function() {
return gulp.src('./src/*.js')
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'))
});