This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const tsConfig = require("./tsconfig.json"); | |
const tsConfigPaths = require("tsconfig-paths"); | |
function formatPaths(){ | |
const newPaths = {}; | |
for (const [ key, paths ] of Object.entries(tsConfig.compilerOptions.paths)) | |
newPaths[key] = paths.map(path => path.replace('src', 'dist')); | |
return newPaths; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const moment = require('moment'); | |
require('moment-timezone'); | |
function log(msg){ | |
const date = `[${moment().tz('Asia/Krasnoyarsk').format('DD.MM.YY HH:mm:ss')}] `; | |
let line = date + msg; | |
console.log(line); | |
line += '\n'; | |
fs.appendFileSync('node.log', line); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gulp = require('gulp'); | |
const path = require('path'); | |
const del = require('del'); | |
const recursiveReaddir = require('recursive-readdir'); | |
const _ = require('lodash'); | |
gulp.watch('src/**/*.ts', async function clean (done) { | |
const srcFiles = await new Promise((resolve, reject) => { | |
recursiveReaddir('src', (err, files) => { | |
if(err) reject(err); |