|
1 |
| -const { src, dest, series, parallel } = require('gulp'); |
2 |
| -const concat = require('gulp-concat'); |
3 |
| -var clean = require('gulp-clean'); |
4 |
| -const zip = require('gulp-zip'); |
5 |
| -const unzip = require('gulp-unzip'); |
| 1 | +const { src, dest, series, parallel } = require('gulp') |
| 2 | +const concat = require('gulp-concat') |
| 3 | +var clean = require('gulp-clean') |
| 4 | +const zip = require('gulp-zip') |
| 5 | +const unzip = require('gulp-unzip') |
6 | 6 |
|
7 | 7 | // cleans up the tempBuild folder
|
8 | 8 | const cleanTempBuild = () => {
|
9 |
| - return src('tempBuild', { read: false, allowEmpty: true }) |
10 |
| - .pipe(clean()); |
| 9 | + return src('tempBuild', { read: false, allowEmpty: true }) |
| 10 | + .pipe(clean()) |
11 | 11 | }
|
12 | 12 |
|
13 | 13 | // cleans up the ui-bundle folder
|
14 | 14 | const cleanUiBuild = () => {
|
15 |
| - return src('build/*', { read: false, allowEmpty: true }) |
16 |
| - .pipe(clean()); |
| 15 | + return src('build/*', { read: false, allowEmpty: true }) |
| 16 | + .pipe(clean()) |
17 | 17 | }
|
18 | 18 |
|
19 | 19 | // unzips the antora ui-bundle into the tempBuild folder
|
20 | 20 | const unzipBundle = () => {
|
21 |
| - return src('../build/ui-bundle.zip') |
22 |
| - .pipe(unzip()) |
23 |
| - .pipe(dest('./tempBuild')); |
24 |
| -}; |
| 21 | + return src('../build/ui-bundle.zip') |
| 22 | + .pipe(unzip()) |
| 23 | + .pipe(dest('./tempBuild')) |
| 24 | +} |
25 | 25 |
|
26 | 26 | const cleanImg = () => {
|
27 |
| - return src('tempBuild/img', { read: false, allowEmpty: true }) |
28 |
| - .pipe(clean()); |
| 27 | + return src('tempBuild/img', { read: false, allowEmpty: true }) |
| 28 | + .pipe(clean()) |
29 | 29 | }
|
30 | 30 |
|
31 | 31 | const cleanHBLayouts = () => {
|
32 |
| - return src(['tempBuild/layouts','tempBuild/partials'],{read:false,allowEmpty:true}) |
33 |
| - .pipe(clean()); |
| 32 | + return src(['tempBuild/layouts', 'tempBuild/partials'], { read: false, allowEmpty: true }) |
| 33 | + .pipe(clean()) |
34 | 34 | }
|
35 | 35 |
|
36 | 36 | const cleanBuild = () => {
|
37 |
| - return src('styles/build',{read:false,allowEmpty:true}) |
38 |
| - .pipe(clean()); |
| 37 | + return src('styles/build', { read: false, allowEmpty: true }) |
| 38 | + .pipe(clean()) |
39 | 39 | }
|
40 | 40 |
|
| 41 | +// eslint-disable-next-line no-unused-vars |
41 | 42 | const bundleJSsrc = () =>
|
42 |
| - src('styles/src/js/*.js') |
| 43 | + src('styles/src/js/*.js') |
43 | 44 | .pipe(concat('site.js'))
|
44 |
| - .pipe(dest('styles/build/js')); |
| 45 | + .pipe(dest('styles/build/js')) |
45 | 46 |
|
46 | 47 | // Bundle a site.js for the 404 error page, excluding 01-nav.js
|
47 |
| -const bundleJS404 = () =>{ |
48 |
| - return src(['styles/src/js/*.js','!styles/src/js/01-nav.js', '!styles/src/js/08-gcx-helios.js']) |
| 48 | +const bundleJS404 = () => { |
| 49 | + return src(['styles/src/js/*.js', '!styles/src/js/01-nav.js', '!styles/src/js/08-gcx-helios.js']) |
49 | 50 | .pipe(concat('site404.js'))
|
50 |
| - .pipe(dest('build/js')); |
| 51 | + .pipe(dest('build/js')) |
51 | 52 | }
|
52 | 53 |
|
53 |
| - |
54 |
| - |
55 | 54 | const mergeJS = () => {
|
56 |
| - return src(['tempBuild/js/site.js', |
| 55 | + return src(['tempBuild/js/site.js', |
| 56 | + 'node_modules/@asciidoctor/tabs/dist/js/tabs.js', |
57 | 57 | 'node_modules/swiper/swiper-bundle.min.js',
|
58 | 58 | 'styles/src/js/06-tabs-block.js',
|
59 | 59 | 'styles/src/js/07-copy-to-clipboard.js',
|
60 |
| - 'styles/src/js/08-gcx-helios.js',]) |
| 60 | + 'styles/src/js/08-gcx-helios.js']) |
61 | 61 | .pipe(concat('site.js'))
|
62 |
| - .pipe(dest('build/js')); |
| 62 | + .pipe(dest('build/js')) |
63 | 63 | }
|
64 | 64 |
|
65 |
| - |
66 | 65 | const bundleJShelpers = () => {
|
67 |
| - return src([ |
68 |
| - '../src/helpers/**/*.js', |
69 |
| - ], {base: '../src/'}) |
70 |
| - .pipe(dest('build/')); |
| 66 | + return src([ |
| 67 | + '../src/helpers/**/*.js', |
| 68 | + ], { base: '../src/' }) |
| 69 | + .pipe(dest('build/')) |
71 | 70 | }
|
72 | 71 |
|
73 | 72 | const bundleStencil = () => {
|
74 |
| - return src([ |
75 |
| - 'styles/src/js/vendor/**/*.js', |
76 |
| - ], {base: 'styles/src/'}) |
77 |
| - .pipe(dest('build/')); |
| 73 | + return src([ |
| 74 | + 'styles/src/js/vendor/**/*.js', |
| 75 | + ], { base: 'styles/src/' }) |
| 76 | + .pipe(dest('build/')) |
78 | 77 | }
|
79 | 78 |
|
80 | 79 | const cleanHighlight = () => {
|
81 |
| - return src('build/js/vendor/highlight.bundle.js') |
82 |
| - .pipe(clean({force:true})) |
| 80 | + return src('build/js/vendor/highlight.bundle.js') |
| 81 | + .pipe(clean({ force: true })) |
83 | 82 | }
|
84 | 83 |
|
85 | 84 | const cleanCSS = () => {
|
86 |
| - return src('build/css/site.css',{force:true,allowEmpty:true}) |
| 85 | + return src('build/css/site.css', { force: true, allowEmpty: true }) |
87 | 86 | .pipe(clean())
|
88 | 87 | }
|
89 | 88 |
|
90 | 89 | const bundleCSS = () =>
|
91 |
| - src(['styles/src/css/**/*.css','!styles/src/css/**/helios-gcx.css','!styles/src/css/**/highlight.css']) |
| 90 | + src(['styles/src/css/**/*.css', '!styles/src/css/**/helios-gcx.css', '!styles/src/css/**/highlight.css']) |
92 | 91 | .pipe(concat('siteTemp.css'))
|
93 |
| - .pipe(dest('styles/build/css')); |
| 92 | + .pipe(dest('styles/build/css')) |
94 | 93 |
|
95 | 94 | const bundleHeliosCSS = () =>
|
96 |
| - src(['styles/build/css/siteTemp.css', |
| 95 | + src(['styles/build/css/siteTemp.css', |
97 | 96 | 'styles/src/css/helios-gcx-*.css'])
|
98 | 97 | .pipe(concat('site.css'))
|
99 |
| - .pipe(dest('build/css')); |
| 98 | + .pipe(dest('build/css')) |
100 | 99 |
|
101 | 100 | const bundleHB = () => {
|
102 |
| - return src([ |
103 |
| - 'styles/src/layouts/**/*.hbs', |
104 |
| - 'styles/src/partials/**/*.hbs' |
105 |
| - ], {base: 'styles/src/'}) |
106 |
| - .pipe(dest('build/')); |
| 101 | + return src([ |
| 102 | + 'styles/src/layouts/**/*.hbs', |
| 103 | + 'styles/src/partials/**/*.hbs', |
| 104 | + ], { base: 'styles/src/' }) |
| 105 | + .pipe(dest('build/')) |
107 | 106 | }
|
108 | 107 |
|
109 | 108 | const bundleImg = () => {
|
110 |
| - return src([ |
111 |
| - 'styles/src/img/**/*.*' |
112 |
| - ], {base: 'styles/src/'}) |
113 |
| - .pipe(dest('build/')); |
| 109 | + return src([ |
| 110 | + 'styles/src/img/**/*.*', |
| 111 | + ], { base: 'styles/src/' }) |
| 112 | + .pipe(dest('build/')) |
114 | 113 | }
|
115 | 114 |
|
116 | 115 | const zipBundle = () => {
|
117 |
| - return src('build/**/*.*') |
| 116 | + return src('build/**/*.*') |
118 | 117 | .pipe(zip('ui-bundle.zip'))
|
119 |
| - .pipe(dest('build/')); |
| 118 | + .pipe(dest('build/')) |
120 | 119 | }
|
121 | 120 |
|
122 | 121 | const cleanHeliosBuild = () => {
|
123 |
| - return src(['build/css', |
| 122 | + return src(['build/css', |
124 | 123 | 'build/helpers',
|
125 | 124 | 'build/img',
|
126 | 125 | 'build/js',
|
127 | 126 | 'build/layouts',
|
128 |
| - 'build/partials'],{read:false,allowEmpty:true}) |
129 |
| - .pipe(clean()); |
| 127 | + 'build/partials'], { read: false, allowEmpty: true }) |
| 128 | + .pipe(clean()) |
130 | 129 | }
|
131 | 130 |
|
132 |
| -exports.bundle = series(cleanTempBuild,cleanUiBuild,unzipBundle,cleanImg,cleanHBLayouts,cleanBuild,cleanCSS,bundleCSS,bundleHeliosCSS, parallel(bundleStencil),bundleJS404, bundleJShelpers, mergeJS, cleanHighlight, bundleHB, bundleImg, zipBundle, cleanTempBuild, cleanHeliosBuild); |
| 131 | +// eslint-disable-next-line max-len |
| 132 | +exports.bundle = series(cleanTempBuild, cleanUiBuild, unzipBundle, cleanImg, cleanHBLayouts, cleanBuild, cleanCSS, bundleCSS, bundleHeliosCSS, parallel(bundleStencil), bundleJS404, bundleJShelpers, mergeJS, cleanHighlight, bundleHB, bundleImg, zipBundle, cleanTempBuild, cleanHeliosBuild) |
0 commit comments