format import os from 'os' ; import fs from 'fs-extra' ; export default async function stripSourceMapComment ( out ) { const lines = ( await fs . readFile ( out , 'utf-8' ) ) . split ( os . EOL ) ; const lastLine = lines [ lines . length - 1 ] ; if ( lastLine . startsWith ( '//# sourceMappingURL=' ) ) { console . log ( `Updating ${ out } to remove sourceMapURL= comment.` ) ; await fs . writeFile ( out , lines . slice ( 0 , lines . length - 1 ) . join ( os . EOL ) ) ; } }