LoginSignup
1
1

More than 5 years have passed since last update.

angular-cliのgithub-pages:deploy時のbaseディレクトリの設定

Last updated at Posted at 2016-05-13

package.jsonのnameと対応している。

  • angular-cli 1.0.0-beta.1

もっとくわしく

angular-cliは

$ ng github-pages:deploy

でGitHubPagesにデプロイできる。ただし、プロジェクト名とリポジトリ名が一致していない場合、デプロイされたアプリがうまくうごかない。
index.htmlの<base href="/">の部分を空気読んで置換してくれているが、元にするのがプロジェクトの名前のため、javascriptの参照に失敗する。

        .then((data) => data.replace(/<base href="\/">/g, `<base href="/${projectName}/>"`))
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1