创建项目 JavaScript 项目时,我的标准文件布局如下所示:
project-name/
|- bower_components/
|- node_modules/
|- src/
|- tests/
|- .csslintrc
|- .jshintrc
|- .htmlhintrc
|- bower.json
|- Gruntfile.js
`- package.json
node_modules
并且bower_components
是标准的。我还注意到src
orwww
是源文件的某种标准,而spec
, specs
, test
ortests
主要用于测试。dist
放置可发布文件非常常见。
但是,我也经常得到生成的文件,例如css
从我的文件中生成的less
文件。这些文件在发布时属于该dist
文件夹,但是在网络服务器上进行本地测试时,是否有某种标准可以将这些文件放在哪里?倾向于使用bower_components
,因为它已经托管在本地网络服务器上,但感觉不对。