Use native fs promise where possible (#1684)

This commit is contained in:
lublak
2021-05-01 04:22:15 +02:00
committed by GitHub
parent b7a074abd7
commit c83c05456d
7 changed files with 21 additions and 38 deletions

View File

@@ -1,9 +1,13 @@
import { ChildProcess, spawn } from 'child_process';
const copyfiles = require('copyfiles');
import {
readFile as fsReadFile,
} from 'fs/promises';
import {
write as fsWrite,
} from 'fs';
import { join } from 'path';
import { file } from 'tmp-promise';
import { promisify } from 'util';
@@ -32,7 +36,7 @@ export async function createCustomTsconfig () {
const tsconfigPath = join(__dirname, '../../src/tsconfig-build.json');
// Read the tsconfi file
const tsConfigString = await fsReadFileAsync(tsconfigPath, { encoding: 'utf8'}) as string;
const tsConfigString = await fsReadFile(tsconfigPath, { encoding: 'utf8'}) as string;
const tsConfig = JSON.parse(tsConfigString);
// Set absolute include paths