Git 克隆不会自动克隆子模块,导致 heroku 自动部署出现问题

Git clone doesn't auto-clone submodules, causes issues with heroku auto deploy

我有一个 git 存储库,里面有一个子模块,我想在自动部署的管道上部署到 heroku,但是当 ng build --prod 进程接近完成时,我收到错误

ERROR in : Couldn't resolve resource ./repo/style.css relative to /tmp/build_d3089108a84fd9e7fb117fed84b787b6/src/app/resume/resume.component.ts

因为我的子模块(存在于 /src/app/resume/repo)在文件 resume.component.ts:

中被引用
@Component({
  selector: 'app-resume',
  templateUrl: './repo/resume.html',
  styleUrls: ['./repo/style.css']
})

虽然 github repo 指向子模块的特定提交,但初始 git 克隆不会将子模块与其一起克隆。

我的.gitmodules文件如下:

[submodule "Resume"]
    path = src/app/resume/repo
    url = https://github.com/<my username>/Resume.git

问题:

有没有办法强制 heroku-git 在克隆完整 repo 的同时克隆子模块?

我可以 运行 一个脚本让 heroku 在克隆完整的 repo 但在 构建之前自行克隆子模块吗?

在 Heroku 上使用 GitHub 回购子模块的唯一问题是: