Skip to content
This repository was archived by the owner on Apr 24, 2024. It is now read-only.

Commit e389678

Browse files
committed
chore: update build
1 parent 8c6568e commit e389678

File tree

4 files changed

+129
-4
lines changed

4 files changed

+129
-4
lines changed

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ install:
77
- yarn
88
script:
99
- gulp build
10-
- cp -rf src/ dist
1110
cache:
1211
yarn: true
1312
directories:

gulpfile.js

+24-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,34 @@
11
const gulp = require('gulp');
22
const yml = require('gulp-yaml');
3+
const htmlmin = require("gulp-htmlmin");
4+
const htmlclean = require("gulp-htmlclean");
35

4-
gulp.task('build', () => {
6+
let yml2json = () => {
57
return gulp.src('./src/cdn.yml')
68
.pipe(yml({
79
schema: 'DEFAULT_SAFE_SCHEMA',
810
space: 2,
911
}))
10-
.pipe(gulp.dest('./dist/'))
11-
});
12+
.pipe(gulp.dest('./dist/'));
13+
}
14+
15+
let minifyHTML = () => {
16+
return gulp.src('src/*.html')
17+
.pipe(htmlmin({
18+
removeComments: true,
19+
minifyJS: true,
20+
minifyCSS: true,
21+
collapseWhitespace: true
22+
}))
23+
.pipe(gulp.dest('dist'));
24+
}
25+
26+
exports.minifyHTML = minifyHTML;
27+
exports.yml2json = yml2json;
28+
29+
gulp.task('build', gulp.series(
30+
yml2json,
31+
minifyHTML
32+
));
1233

1334
gulp.task('default', gulp.parallel('build'));

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"private": true,
55
"dependencies": {
66
"gulp": "^4.0.0",
7+
"gulp-htmlclean": "^2.7.22",
8+
"gulp-htmlmin": "^5.0.1",
79
"gulp-yaml": "^2.0.2"
810
}
911
}

yarn.lock

+103
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,14 @@ cache-base@^1.0.1:
275275
union-value "^1.0.0"
276276
unset-value "^1.0.0"
277277

278+
279+
version "3.0.0"
280+
resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73"
281+
integrity sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=
282+
dependencies:
283+
no-case "^2.2.0"
284+
upper-case "^1.1.1"
285+
278286
camelcase@^3.0.0:
279287
version "3.0.0"
280288
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a"
@@ -315,6 +323,13 @@ class-utils@^0.3.5:
315323
isobject "^3.0.0"
316324
static-extend "^0.1.1"
317325

326+
327+
version "4.2.1"
328+
resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.2.1.tgz#2d411ef76b8569b6d0c84068dabe85b0aa5e5c17"
329+
integrity sha512-4ZxI6dy4lrY6FHzfiy1aEOXgu4LIsW2MhwG0VBKdcoGoH/XLFgaHSdLTGr4O8Be6A8r3MOphEiI8Gc1n0ecf3g==
330+
dependencies:
331+
source-map "~0.6.0"
332+
318333
cliui@^3.2.0:
319334
version "3.2.0"
320335
resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d"
@@ -375,6 +390,11 @@ color-support@^1.1.3:
375390
resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2"
376391
integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==
377392

393+
[email protected], commander@~2.17.1:
394+
version "2.17.1"
395+
resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf"
396+
integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==
397+
378398
component-emitter@^1.2.1:
379399
version "1.2.1"
380400
resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6"
@@ -879,6 +899,24 @@ gulp-cli@^2.0.0:
879899
v8flags "^3.0.1"
880900
yargs "^7.1.0"
881901

902+
gulp-htmlclean@^2.7.22:
903+
version "2.7.22"
904+
resolved "https://registry.yarnpkg.com/gulp-htmlclean/-/gulp-htmlclean-2.7.22.tgz#a7811de8d1221122ae60d660ca0170b65b698dde"
905+
integrity sha1-p4Ed6NEiESKuYNZgygFwtltpjd4=
906+
dependencies:
907+
htmlclean "~3.0.8"
908+
plugin-error "^1.0.1"
909+
through2 "^2.0.3"
910+
911+
gulp-htmlmin@^5.0.1:
912+
version "5.0.1"
913+
resolved "https://registry.yarnpkg.com/gulp-htmlmin/-/gulp-htmlmin-5.0.1.tgz#90fc5e8ad0425a9e86d5d521427184e7276365e7"
914+
integrity sha512-ASlyDPZOSKjHYUifYV0rf9JPDflN9IRIb8lw2vRqtYMC4ljU3zAmnnaVXwFQ3H+CfXxZSUesZ2x7jrnPJu93jA==
915+
dependencies:
916+
html-minifier "^3.5.20"
917+
plugin-error "^1.0.1"
918+
through2 "^2.0.3"
919+
882920
gulp-yaml@^2.0.2:
883921
version "2.0.2"
884922
resolved "https://registry.yarnpkg.com/gulp-yaml/-/gulp-yaml-2.0.2.tgz#a670c4f72c8c1e25e2143c7e15c1b9425ec06539"
@@ -949,6 +987,11 @@ has-values@^1.0.0:
949987
is-number "^3.0.0"
950988
kind-of "^4.0.0"
951989

990+
991+
version "1.2.0"
992+
resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
993+
integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==
994+
952995
homedir-polyfill@^1.0.1:
953996
version "1.0.1"
954997
resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz#4c2bbc8a758998feebf5ed68580f76d46768b4bc"
@@ -961,6 +1004,24 @@ hosted-git-info@^2.1.4:
9611004
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047"
9621005
integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==
9631006

1007+
html-minifier@^3.5.20:
1008+
version "3.5.21"
1009+
resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.21.tgz#d0040e054730e354db008463593194015212d20c"
1010+
integrity sha512-LKUKwuJDhxNa3uf/LPR/KVjm/l3rBqtYeCOAekvG8F1vItxMUpueGd94i/asDDr8/1u7InxzFA5EeGjhhG5mMA==
1011+
dependencies:
1012+
camel-case "3.0.x"
1013+
clean-css "4.2.x"
1014+
commander "2.17.x"
1015+
he "1.2.x"
1016+
param-case "2.1.x"
1017+
relateurl "0.2.x"
1018+
uglify-js "3.4.x"
1019+
1020+
htmlclean@~3.0.8:
1021+
version "3.0.8"
1022+
resolved "https://registry.yarnpkg.com/htmlclean/-/htmlclean-3.0.8.tgz#cea451cf5399d4018386a57129489f2d630e62b0"
1023+
integrity sha1-zqRRz1OZ1AGDhqVxKUifLWMOYrA=
1024+
9641025
iconv-lite@^0.4.4:
9651026
version "0.4.24"
9661027
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
@@ -1300,6 +1361,11 @@ lodash.debounce@^4.0.8:
13001361
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
13011362
integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168=
13021363

1364+
lower-case@^1.1.1:
1365+
version "1.1.4"
1366+
resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac"
1367+
integrity sha1-miyr0bno4K6ZOkv31YdcOcQujqw=
1368+
13031369
make-iterator@^1.0.0:
13041370
version "1.0.1"
13051371
resolved "https://registry.yarnpkg.com/make-iterator/-/make-iterator-1.0.1.tgz#29b33f312aa8f547c4a5e490f56afcec99133ad6"
@@ -1441,6 +1507,13 @@ next-tick@1:
14411507
resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c"
14421508
integrity sha1-yobR/ogoFpsBICCOPchCS524NCw=
14431509

1510+
no-case@^2.2.0:
1511+
version "2.3.2"
1512+
resolved "https://registry.yarnpkg.com/no-case/-/no-case-2.3.2.tgz#60b813396be39b3f1288a4c1ed5d1e7d28b464ac"
1513+
integrity sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==
1514+
dependencies:
1515+
lower-case "^1.1.1"
1516+
14441517
node-pre-gyp@^0.10.0:
14451518
version "0.10.3"
14461519
resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc"
@@ -1625,6 +1698,13 @@ osenv@^0.1.4:
16251698
os-homedir "^1.0.0"
16261699
os-tmpdir "^1.0.0"
16271700

1701+
1702+
version "2.1.1"
1703+
resolved "https://registry.yarnpkg.com/param-case/-/param-case-2.1.1.tgz#df94fd8cf6531ecf75e6bef9a0858fbc72be2247"
1704+
integrity sha1-35T9jPZTHs915r75oIWPvHK+Ikc=
1705+
dependencies:
1706+
no-case "^2.2.0"
1707+
16281708
parse-filepath@^1.0.1:
16291709
version "1.0.2"
16301710
resolved "https://registry.yarnpkg.com/parse-filepath/-/parse-filepath-1.0.2.tgz#a632127f53aaf3d15876f5872f3ffac763d6c891"
@@ -1827,6 +1907,11 @@ regex-not@^1.0.0, regex-not@^1.0.2:
18271907
extend-shallow "^3.0.2"
18281908
safe-regex "^1.1.0"
18291909

1910+
1911+
version "0.2.7"
1912+
resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9"
1913+
integrity sha1-VNvzd+UUQKypCkzSdGANP/LYiKk=
1914+
18301915
remove-bom-buffer@^3.0.0:
18311916
version "3.0.0"
18321917
resolved "https://registry.yarnpkg.com/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz#c2bf1e377520d324f623892e33c10cac2c252b53"
@@ -2037,6 +2122,11 @@ source-map@^0.5.6:
20372122
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
20382123
integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=
20392124

2125+
source-map@~0.6.0, source-map@~0.6.1:
2126+
version "0.6.1"
2127+
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
2128+
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
2129+
20402130
sparkles@^1.0.0:
20412131
version "1.0.1"
20422132
resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.1.tgz#008db65edce6c50eec0c5e228e1945061dd0437c"
@@ -2240,6 +2330,14 @@ typedarray@^0.0.6:
22402330
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
22412331
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
22422332

2333+
2334+
version "3.4.9"
2335+
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.9.tgz#af02f180c1207d76432e473ed24a28f4a782bae3"
2336+
integrity sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==
2337+
dependencies:
2338+
commander "~2.17.1"
2339+
source-map "~0.6.1"
2340+
22432341
unc-path-regex@^0.1.2:
22442342
version "0.1.2"
22452343
resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa"
@@ -2296,6 +2394,11 @@ upath@^1.0.5:
22962394
resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd"
22972395
integrity sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw==
22982396

2397+
upper-case@^1.1.1:
2398+
version "1.1.3"
2399+
resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-1.1.3.tgz#f6b4501c2ec4cdd26ba78be7222961de77621598"
2400+
integrity sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=
2401+
22992402
urix@^0.1.0:
23002403
version "0.1.0"
23012404
resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72"

0 commit comments

Comments
 (0)