import fs from 'fs' ; const pkg = require ( "./package.json" ) ; const version = pkg . version ; const buff = fs . readFileSync ( 'web/js/util/Version.ts' ) ; const content = buff . toString ( 'utf-8' ) ; content . replace ( /foo/ , `asdf` ) ;