fix(cli): publish nuxt and nuxt-edge in nuxt-edge (#4341)

This commit is contained in:
Clark Du 2018-11-16 13:47:15 +00:00 committed by Sébastien Chopin
parent 3abc9e815e
commit cca799cc6f

View File

@ -95,8 +95,10 @@ export default class Package extends EventEmitter {
suffixAndVersion() {
this.logger.info(`Adding suffix ${this.options.suffix}`)
const oldPkgName = this.pkg.name
// Add suffix to the package name
if (!this.pkg.name.includes(this.options.suffix)) {
if (!oldPkgName.includes(this.options.suffix)) {
this.pkg.name += this.options.suffix
}
@ -111,6 +113,14 @@ export default class Package extends EventEmitter {
}
}
if (typeof this.pkg.bin === 'string') {
const bin = this.pkg.bin
this.pkg.bin = {
[oldPkgName]: bin,
[this.pkg.name]: bin
}
}
this.generateVersion()
}