UNPKG

375 BJavaScriptView Raw
1const { readFileSync, writeFileSync } = require('fs')
2const { editDebugCode, editVersion } = require('debugcode')
3
4module.exports = (file, options) => {
5 let js = readFileSync(file, 'utf8')
6
7 js = editDebugCode(js, options.env)
8 let r = editVersion(js, options.versionDefault, file, options.env)
9 options.versionHash = r.hash
10
11 writeFileSync(file, r.code)
12}