-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathgulpfile.js
38 lines (34 loc) · 1.02 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
// This is the script used to uglify and minify the simplyLazy.js and it will place the
// minified script in both the `./dist` directory and the `./docs` directory so that the
// GitHub pages is automatically updated as well
function defaultTask(cb) {
cb();
}
exports.default = defaultTask;
const gulp = require('gulp');
const babel = require('gulp-babel');
const uglify = require('gulp-uglify');
const rename = require('gulp-rename');
const headerComment = require('gulp-header-comment');
gulp.task('js-minify', function () {
return gulp
.src(['./src/components/simpleRange.js'])
.pipe(
babel({
presets: ['@babel/preset-env'],
})
)
.pipe(uglify())
.pipe(
rename(function (path) {
path.extname = '.min.js';
})
)
.pipe(
headerComment(
'Max Poshusta | v1.0.16 | MIT License | https://github.com/maxshuty/accessible-web-components | https://www.linkedin.com/in/maxposhusta'
)
)
.pipe(gulp.dest('./dist'))
.pipe(gulp.dest('./docs'));
});