-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
75 lines (75 loc) · 1.87 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// 'use strict';
//
// const gulp = require('gulp');
// const gulpif = require('gulp-if');
// const htmlmin = require('gulp-htmlmin');
// const uglify = require('gulp-uglify');
// const uuidv1 = require('uuid/v1');
// const csso = require('gulp-csso');
// const concat = require('gulp-concat');
// const del = require('del');
// const replace = require('gulp-replace');
//
// const ALL_FOR_ONE_FILE_HASH = uuidv1();
//
// /**
// * Tasks:
// * - Clean
// */
// gulp.task('clean', del.bind(null, ['gulp_build']));
//
// /**
// * Tasks:
// * - Uglify JS
// * - Minify CSS and HTML
// */
// gulp.task('pack', function () {
//
// return gulp.src([
// 'docs/*',
// 'docs/**/*'
// ])
// // Scripts
// .pipe(gulpif('*.js', uglify()))
// // Styles
// .pipe(gulpif('*.css', csso()))
// // HMTL
// .pipe(gulpif('*.html', htmlmin({collapseWhitespace: true})))
// // DEST
// .pipe(gulp.dest('gulp_build'));
//
// });
//
// /**
// * Tasks:
// * - Build an single JS FILE
// */
// gulp.task('packJS', function () {
// return gulp.src([
// 'gulp_build/main.*.js',
// 'gulp_build/polyfills.*.js',
// 'gulp_build/runtime.*.js',
// 'gulp_build/scripts.*.js',
// ])
// .pipe(concat('all.' + ALL_FOR_ONE_FILE_HASH + '.js'))
// .pipe(gulp.dest('gulp_build'));
// });
//
// /**
// * Tasks:
// * - Update index.html with the "single JS FILE name"
// */
// gulp.task('allForOneMain', function(){
// return gulp.src([
// 'gulp_build/index.html',
// ])
// .pipe(replace(/main.+?js/g, 'all.' + ALL_FOR_ONE_FILE_HASH + '.js'))
// .pipe(replace(/polyfills.+?js/g, ''))
// .pipe(replace(/scripts.+?js/g, ''))
// .pipe(replace(/runtime.+?js/g, ''))
// .pipe(gulp.dest('gulp_build'));
// });
//
// gulp.task('singleJSFILE', gulp.series('packJS', 'allForOneMain'));
//
// gulp.task('default', gulp.series('clean', 'pack', 'singleJSFILE'));