-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
52 lines (43 loc) · 1.07 KB
/
gulpfile.babel.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
/* ==================================
* @ 2017 FEZ前端模块化工程开发框架
* https://github.com/furic-zhao/fez
* ================================== */
/**
* Nodejs处理文件
* http://nodejs.cn/api/fs
*/
import fs from 'fs';
/**
* Nodejs处理路径
* http://nodejs.cn/api/path.html
*/
import path from 'path';
/**
* 命令行日志
* https://www.npmjs.com/package/fancy-log
*/
import fancyLog from 'fancy-log';
/**
* 命令行颜色
* https://github.com/doowb/ansi-colors
*/
import ansiColors from 'ansi-colors';
/**
* 如果您的项目目录相对于fez工程目录层级太深
* 请修改此数值
*/
let fezDeep = 3;
const fez = (fezDirectory) => {
if (--fezDeep < 0) {
fancyLog(ansiColors.cyan("您的项目目录层级太深"));
fancyLog(ansiColors.cyan("请修改 gulpfile 文件中的 fezDeep 为更大的数值"));
return;
}
fezDirectory = path.join('../', fezDirectory);
if (fs.existsSync(fezDirectory)) {
require(fezDirectory).default();
} else {
fez(fezDirectory);
}
}
fez('.fez');