【问题标题】:Is there a standard for storing generated files in a JavaScript project? [closed]是否有在 JavaScript 项目中存储生成文件的标准? [关闭]
【发布时间】:2014-05-09 21:01:20
【问题描述】:

创建项目 JavaScript 项目时,我的标准文件布局如下所示:

project-name/
 |- bower_components/
 |- node_modules/
 |- src/
 |- tests/
 |- .csslintrc
 |- .jshintrc
 |- .htmlhintrc
 |- bower.json
 |- Gruntfile.js
 `- package.json

node_modulesbower_components 是标准的。我还注意到srcwww 是源文件的某种标准,specspecstesttests 主要用于测试。 dist 用于放置可发布文件非常常见。

但是,我也经常得到生成的文件,例如从我的less 文件生成的css。这些文件在发布时属于dist 文件夹,但是在网络服务器上进行本地测试时,是否有某种标准可以将这些文件放在哪里?倾向于使用bower_components,因为它已经托管在本地网络服务器上,但感觉不对。

【问题讨论】:

    标签: javascript project-layout


    【解决方案1】:

    3.3。 CSS 文件必须具有文件扩展名 .css 并且应该存储在站点结构中的相关包含目录中,通常 /风格/。

    来源:http://www.bbc.co.uk/guidelines/futuremedia/technical/css.shtml

    /资产/

    /资源/

    是 css 文件的其他常见位置 参见例如https://github.com/h5bp/html5-boilerplate/issues/1121

    另见类似问题Naming convention for assets (images, css, js)?

    总而言之,这取决于您,但请确保它是一致且合乎逻辑的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-09-17
      • 2023-01-02
      • 2019-08-19
      • 2015-03-01
      • 1970-01-01
      • 2010-09-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多