UNPKG

768 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const map = require("map-stream");
4const path = require("path");
5const fancyLog = require("fancy-log");
6const colors = require("ansi-colors");
7let log = fancyLog;
8function setLogFunction(fn) {
9 log = fn;
10}
11exports.setLogFunction = setLogFunction;
12function gulpPrint(format) {
13 if (!format) {
14 format = (filepath) => filepath;
15 }
16 function mapFile(file, cb) {
17 const filepath = colors.magenta(path.relative(process.cwd(), file.path));
18 const formatted = format(filepath);
19 if (formatted) {
20 log(formatted);
21 }
22 cb(null, file);
23 }
24 return map(mapFile);
25}
26exports.default = gulpPrint;
27//# sourceMappingURL=gulp-print.js.map
\No newline at end of file