import Fs from 'fs' ; import { promisify } from 'util' ; import del from 'del' ; import { BuildContext } from '../build_context' ; const asyncMkdir = promisify ( Fs . mkdir ) ; export async function initTargets ( { log , sourceDir , buildDir } ) { log . info ( 'deleting the build and target directories' ) ; await del ( [ 'build' , 'target' ] , { cwd : sourceDir , } ) ; log . debug ( `creating build output dir [${ buildDir }]` ) ; await asyncMkdir ( buildDir , { recursive : true } ) ; }