git - .gitignore 中的语义 UI

标签 git semantic-ui

我最近开始尝试使用语义 UI。我在我保存在 git repo 中的项目中使用它。

我使用所有默认设置将语义文件添加到项目根目录中的语义 文件夹。我以后可能会也可能不会更改这些设置。

我的问题是,如何正确地将文件夹添加到 git?如果可能的话,我不想添加稍后可以使用 gulp 简单地重建的文件。我应该添加哪些文件以及应该忽略哪些文件?

最佳答案

我最终部分遵循了@fstanis 在 How can I separate generated artifacts from the main build with semantic UI? 的回答, 由@poke 链接。

我保留了:

  • semantic.json
  • 语义/src/
  • semantic/gulpfile.js(因为我没有在项目的其他地方使用 gulp)

我忽略了:

  • 语义/距离/
  • semantic/tasks/,因为它与 node_modules/semantic-ui/tasks 完全相同,因此可以复制

我还如下扩充了 semantic/gulpfile.js 以检查 semantic/tasks 是否存在,如果不存在则将其复制到那里。

/* Very top of semantic/gulpfile.js */
var fs = require('fs-extra'); // Used for recursive copying
var path = require('path');
try {
    var stat = fs.statSync(path.join(__dirname, './tasks'));
    console.log('\'tasks\' folder already exists. Continuing.')
} catch (e) {
    console.log('Copying \'tasks\' folder from \'node_modules/semantic-ui/tasks\'');
    fs.copySync(path.join(__dirname, '../node_modules/semantic-ui/tasks'), path.join(__dirname, './tasks'));
    console.log('Copying done! Continuing.');
}

这似乎是可构建的语义 UI 安装所需的最低要求。

关于git - .gitignore 中的语义 UI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32538811/

相关文章:

semantic-ui - 菜单不适用于示例代码等语义 UI

css - 使用语义卡片跨行对齐卡片图像

git - TFS 2013 是否有搁置集(使用 GIT 时)?

Git:如何获取推送到远程主控的分支列表?

xml - git rerere 如何找出两个冲突之间的相似之处?

c++ - 如何使用 Eclipse CDT 构建 C++ 项目?

linux - 试图从 git repo 中删除一个大文件夹但花费的时间太长

semantic-ui - 如何创建没有边框的语义 CSS 表/行?

jquery - 语义 ui 下拉菜单不起作用

javascript - Semantic UI React - 当下拉选项列表仍然打开时不触发 onChange