0

私は主にjqueryとノックアウトを使用するかなり大きなjavascriptアプリケーションを持っています。基本的に、フォルダー構造を1つ大きく分離すると、作成appしたすべてのコードが含まれ、さらに定数、ビュー、モデル、およびビューモデルに分割されます。次にvendor、jquery、ノックアウト、プラグインなど、作成しなかったコードがあります。私が抱えている問題は、その間にあるものをどこに置くかです。ノックアウト用のカスタムバインディングをいくつか作成し、いくつかのjqueryプラグインの機能を拡張しましたが、それらは私のappディレクトリのルートにあります。このためのベストプラクティスまたは命名規則は何ですか。

+app
 -- constants
 -- models
 -- viewmodels
 -- views
 jquery-plugin-extras.js
 knockout-bindings.js
 etc
+vendor
 jquery.min.js
 knockout.min.js
 jquery-plugin.min.js
4

1 に答える 1

0
+app
 -- system (or core) //contains core or system related generics
 -- config // single place to store your configurations, if you have just one, put it at the root
 -- plugins // all plugins or ko bindings here
 -- constants
 -- models
 -- viewmodels
 -- views
 -- main.js // any bootstrapping, initial configurations and such go in to this file.
+lib
 --jquery.min.js
 --knockout.min.js
 --jquery-plugin.min.js
于 2013-03-21T16:19:30.293 に答える