1 | const { readFileSync, writeFileSync } = require('fs')
|
2 | const { editDebugCode, editVersion } = require('debugcode')
|
3 |
|
4 | module.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 | }
|