-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjs-build.js
28 lines (24 loc) · 874 Bytes
/
js-build.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
'use strict';
const $ = require('gulp-load-plugins')();
const gulp = require('gulp');
const pump = require('pump'); // https://github.com/gulpjs/gulp/tree/master/docs/why-use-pump
const replace = require('gulp-replace'); // ??? why does not work "$.replace"
module.exports = function(options) {
return function(callback) {
pump([
gulp.src(options.src, {since: gulp.lastRun(options.taskName)}),
replace('\'', '"'), // https://www.npmjs.com/package/gulp-replace
$.debug({title: options.taskName}), // ?????
gulp.dest(options.dest),
$.jshint(),
$.jshint.reporter('jshint-stylish'),
$.jshint.reporter('fail'), // https://www.npmjs.com/package/gulp-jshint
$.uglify({output: {comments: /^!/}}),
$.debug({title: options.taskName}), // ?????
$.rename({suffix: '.min'}),
gulp.dest(options.dest),
],
callback
);
};
};