0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ASP.NET > Core2 > デプロイしてもWebが反応しない時

Last updated at Posted at 2018-11-29

忘れるのでメモ

仮想パスを切っている環境にデプロイしても、

以下のようにサーバー直下を参照してしまって、Webが表示できない場合がある。

そういう時には、以下のようにpackage.json にhomepageを追加する

{
  "name": "projectname",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "bootstrap": "^3.3.7",
    "react": "^16.0.0",
    "react-bootstrap": "^0.31.5",
    "react-dom": "^16.0.0",
  },
  "scripts": {
    "start": "rimraf ./build && react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  },
  "homepage": "/pathname/"
}

以下のように、build/index.htmlファイル中のパスに仮想パスが追加される。

src="/pathname/static/js/main.98ccb00e.js"
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?