LoginSignup
0
0

More than 5 years have passed since last update.

heroku-static-providerを使う際にCDN以外で参照しているファイル名がドット区切りリソースが取得できない

Last updated at Posted at 2016-09-28

環境

  • heroku
  • http://github.com/nulltask/heroku-static-provider

現象

fullPage.jsを取り込んだ静的ページをデプロイし動作確認したところ、一部のスタイルシートとJavaScriptファイルのリクエストが404応答だった。

対応前ディレクトリ構造
current directory
│   .gitignore
│   package.json
│   Procfile
│   server.js
│
└───public
    │   index.html
    │
    ├───css
    │       jquery.fullPage.css ★
    │       style.css
    │
    ├───img
    │       image1.png
    │
    └───js
            jquery.easings.min.js ★
            jquery.fullpage.js ★
            main.js
            scrolloverflow.js
            scrolloverflow.min.js

chromeのDevToolで確認したところ、上記★のファイルに404応答があり、デザイン等が崩れた。

対応

Google JavaScript Style Guide 和訳に準じたファイル名に変更した。

対応後ディレクトリ構造
current directory
│   .gitignore
│   package.json
│   Procfile
│   server.js
│
└───public
    │   index.html
    │
    ├───css
    │       fullpage.css ★
    │       style.css
    │
    ├───img
    │       image1.png
    │
    └───js
            easings.js ★
            fullpage.js ★
            main.js
            scrolloverflow.js
            scrolloverflow.min.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