Skip to content

Commit ecb4a4b

Browse files
committed
fix: load prebuild-package.json in a try/catch
1 parent 2fdfc61 commit ecb4a4b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

rollup.config.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ import pascalcase from 'pascalcase'
77
import copy from 'rollup-plugin-copy'
88

99
const pkg = require('./package.json')
10-
const prebuildPkg = require('./temp/prebuild-package.json')
11-
Object.assign(pkg, prebuildPkg)
10+
try {
11+
const prebuildPkg = require('./temp/prebuild-package.json')
12+
Object.assign(pkg, prebuildPkg)
13+
} catch {
14+
console.log("There's no pre-build package.json")
15+
}
1216

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

0 commit comments

Comments
 (0)