Skip to content

Commit

Permalink
Update postinstall.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
hmmhmmhm committed Dec 9, 2019
1 parent 818c325 commit 7e4b24f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions postinstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 13,9 @@ for(let folderName of folderNames){
let packageFilePath = `node_modules/${folderName}/package.json`
let browserListFilePath = `node_modules/${folderName}/.browserslistrc`
let packageFileData = JSON.parse(fs.readFileSync(packageFilePath))
packageFileData['browserslist'] = nodeVersion
// fs.writeFileSync(browserListFilePath, nodeVersion)
if(fs.existsSync(browserListFilePath))
fs.unlinkSync(browserListFilePath)


delete packageFileData['browserslist']
fs.writeFileSync(browserListFilePath, nodeVersion)
fs.writeFileSync(packageFilePath, JSON.stringify(packageFileData, null, 2))
console.log(`Fixed browserlist in ${packageFilePath}`)
}catch(e) {}
Expand Down

0 comments on commit 7e4b24f

Please sign in to comment.