u
This commit is contained in:
@@ -3,7 +3,7 @@ const fs = require('fs')
|
||||
|
||||
// 读取 manifest.json ,修改后重新写入
|
||||
// https://uniapp.dcloud.net.cn/collocation/vue-config.html
|
||||
const manifestPath = path.join(__dirname, 'manifest.json')
|
||||
const manifestPath = path.resolve('manifest.json')
|
||||
let Manifest = fs.readFileSync(manifestPath, { encoding: 'utf-8' })
|
||||
function replaceManifest (path, value) {
|
||||
const arr = path.split('.')
|
||||
@@ -18,7 +18,7 @@ function replaceManifest (path, value) {
|
||||
const hasComma = /,/.test(item)
|
||||
ManifestArr[index] = item.replace(
|
||||
new RegExp(`"${lastItem}"[\\s\\S]*:[\\s\\S]*`),
|
||||
`"${lastItem}" : ${value}${hasComma ? ',' : ''}`
|
||||
`"${lastItem}": ${value}${hasComma ? ',' : ''}`
|
||||
)
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user