1

I am thinking about the best way to define a file structure for a web app using requirejs and backbone. I have two ideas (1) (2).
According to you what is the best or what would you change?


(1)

|-- vendor
     |-- js (jquery, underscore ....)
|-- images
|-- css
|-- spec
|-- templates
|-- js
|    |-- utils
|    |-- models
|    |-- collections
|    |-- views
|    conf.js
|    app.js
|    router.js
|- index.html

(2)

|-- assets
       |-- js (jquery, underscore ....)
       |-- css
       |-- images
|-- src
       |-- templates
       |-- js
            |-- views
            |-- models
            |-- collections
            |-- utils
           conf.js
           app.js
           router.js
|-- spec         
|-- index.html
4

1 に答える 1

2

実際には、さまざまな方法でさまざまな方法の長所と短所があります. 最も重要なことは、ファイルを整理する適切な方法を見つけることです. 以下は、私が現在行っているプロジェクトの整理です. このようにして、フォーカスは同じモジュール関連のファイルがフォルダーに配置されます。例: people モジュール、このモジュールのすべてのファイルは modules / base / people ディレクトリに配置されます。このモジュールの更新とメンテナンス後は、このディレクトリ内のファイルのみに集中する必要があり、ディレクトリ外のファイルには影響しません。また、メンテナンス性が向上します。

私の答えがあなたに役立つことを願っています。貴重なアドバイスを願っています。

ここに画像の説明を入力

于 2012-06-14T14:38:35.530 に答える