import path from "path" ; import fs from "../../utils/fs" ; param { Output } output param { string } filePath param { Buffer | String } content return { Promise } function writeFile ( output , filePath , content ) { const rootFolder = output . getRoot ( ) ; filePath = path . join ( rootFolder , filePath ) ; return fs . ensureFile ( filePath ) . then ( ( ) => { return fs . writeFile ( filePath , content ) ; } ) . thenResolve ( output ) ; } export default writeFile ;