extendPackageJson (extPkg) {
    if (!extPkg) return

    if (typeof extPkg === 'string') {
      const dir = getCallerPath()
      const source = path.resolve(dir, extPkg)

      if (!fs.existsSync(source)) {
        warn()
        warn(`Extension(${ this.extId }): extendPackageJson() - cannot locate ${ extPkg }. Skipping...`)
        warn()
        return
      }
      if (fs.lstatSync(source).isDirectory()) {
        warn()
        warn(`Extension(${ this.extId }): extendPackageJson() - "${ extPkg }" is a folder instead of file. Skipping...`)
        warn()
        return
      }

      try {
        extPkg = JSON.parse(
          fs.readFileSync(source, 'utf-8')
        )
      }
      catch (_) {
        warn(`Extension(${ this.extId }): extendPackageJson() - "${ extPkg }" is malformed`)
        warn()
        process.exit(1)
      }
    }

    if (
      Object(extPkg) !== extPkg
      || Object.keys(extPkg).length === 0
    ) return

    const pkg = merge({}, this.ctx.pkg.appPkg, extPkg)

    fs.writeFileSync(
      this.resolve.app('package.json'),
      stringifyJSON(pkg),
      'utf-8'
    )

    if (
      extPkg.dependencies
      || extPkg.devDependencies
      || extPkg.optionalDependencies
      || extPkg.bundleDependencies
      || extPkg.peerDependencies
    ) {
      this.#needsNodeModulesUpdate = true
    }
  }
Extend package.json with new props.
If specifying existing props, it will override them.

@param {object|string} extPkg - Object to extend with or relative path to a JSON file