Skip to content

Commit

Permalink
fix: load prebuild-package.json in a try/catch
Browse files Browse the repository at this point in the history
  • Loading branch information
luthfimasruri committed Mar 25, 2021
1 parent 2fdfc61 commit ecb4a4b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ import pascalcase from 'pascalcase'
import copy from 'rollup-plugin-copy'

const pkg = require('./package.json')
const prebuildPkg = require('./temp/prebuild-package.json')
Object.assign(pkg, prebuildPkg)
try {
const prebuildPkg = require('./temp/prebuild-package.json')
Object.assign(pkg, prebuildPkg)
} catch {
console.log("There's no pre-build package.json")
}

// get all or any character after '/' in this case 'vue-quill'
const name = pkg.name.match(/[^/]*$/)[0]
Expand Down

0 comments on commit ecb4a4b

Please sign in to comment.