混合模式目录结构
当然,你可以混合使用这些方法,并在特定于应用程序的代码旁边使用包和导入。混合模式结构在三种情况下最常见:一个 franken-app,它只是在没有任何整体策略的情况下从这里和那里拉出一点点; 一个正在从 Classic 或 Package-Only 结构主动重构为 Imports / Modules 结构的应用程序。
client/ # client application code
client/compatibility/ # legacy 3rd party javascript libraries
imports #
imports/api # isomorphic methods
imports/lib # any common code for client/server
imports/client # client application code
imports/server # server code
lib/ # any common code for client/server.
packages/ # place for all your atmosphere packages
packages/foo/client # client application code
packages/foo/lib # any common code for client/server
packages/foo/server # server code
packages/foo/tests # tests
private/ # static files that only the server knows about
public/ # static files that are available to the client
server/ # server code
tests/ # unit test files (won't be loaded on client or server)