This repository was archived by the owner on Feb 22, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.babel.js
More file actions
56 lines (48 loc) · 1.38 KB
/
Copy pathgulpfile.babel.js
File metadata and controls
56 lines (48 loc) · 1.38 KB
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
import gulp from 'gulp';
import config from './gulpfile.config.js';
import { PugMJML } from './gulptasks/PugMJML';
import { ImgExtractor } from './gulptasks/ImgExtractor';
import { SendMail } from './gulptasks/SendMail';
import { Xlsx2json } from './gulptasks/Xlsx2json';
const gs = gulp.series;
const gp = gulp.parallel;
export function pugmjmlTask(done) {
const task = new PugMJML();
task.src = config.pugMJML.MAIN;
task.dest = config.pugMJML.DEST;
task.data = require(config.pugMJML.DATA);
return task.run(done);
}
export function imageExtractorTask(done) {
const task = new ImgExtractor({
src: config.image.HTML,
imageSRC: config.image.imgSRC
});
return task.run(done);
}
export function sendMail(done) {
const task = new SendMail();
task.template = config.sendEmail.template;
task.to = config.sendEmail.to;
task.sender = config.sendEmail.sender || 'Emailing starter kit <gulp.testmail@yahoo.com>';
task.smtpInfo = {
auth: {
user: 'gulp.testmail@yahoo.com',
pass: 'Qwerty@5'
},
host: 'smtp.mail.yahoo.com',
secureConnection: false,
port: 587
};
console.log(task.sender);
return task.run(done);
}
export function xlsx2json(done) {
const task = new Xlsx2json({
src: config.xlsx.SRC,
dest: config.xlsx.DEST
})
return task.run(done);
}
const build = gs(xlsx2json, pugmjmlTask, imageExtractorTask);
export default build;