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 3 years have passed since last update.

web開発におけるディレクトリ構造について、、

Posted at

なぜ、ディレクトリ構成を考える必要があるのか
・ディレクトリ直下に異なる拡張子やファイルが散在してしまう
・設計中にディレクトリ構成の見直しをすると、その都度URLやパスの設定を修正する必要が出てくる。
ディレクトリ構造
/ application
/ css
/ js
/ images
index.html

・ファイル移動したらURLやパスを再設定する

変更後 ↓

・画像ファイルの再指定
〇〇〇
変更後 ↓
〇〇〇

・JSファイルの再指定

      変更後 ↓

その他ディレクトリ構成例
・font・・・外部のフォントデータを入れるディレクトリ
aaa.ttf, bbb.ttf
・scss・・・sassで作成したファイルを入れるディレクトリ
・vendor・・・外部からのライブラリを入れるディレクトリ
jquery, fontawesome など

・webサイトのディレクトリ構造とその命名規制に悩む
・assets:複数形で個人。会社の財産・資産
・public:公開の・共有の
・modules:モジュール
・commons:共通
・resources:資源・供給源・物資

・CSSや、JSををまとめたフォルダの生をどうするか
・フォルダの中身が意味するところで、具体的につける派
style, script, image, include, file, download, document, archive, font, web-fonts, library
・上記の両方が混在してしまう
・ライブラリやおプラグインなどをどこに置くか
・gruntやsassなどのメタ言語の登場で、コンパイル前のことも考えないといけなくなってくる。

結論
・dest -- コンパイル結果
・src -- コンパイル前
・index.html
・assets -- コンパイル後に残らないフォルダは、先頭に「_」をつける
・_coffee -- Coffeescript
・_sass -- Sass
・lib -- Sassの共通ライブラリ
・vendor -- 外部ライブラリ。
・js
・css
・img

・webサイト1ページにつき、1HTMLファイル

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?