纱线发布失败,因为dist文件夹已添加到gitignore

时间:2019-07-26 08:18:35

标签: git npm yarnpkg

Yarn要在发布节点模块时添加git标签。但是,此文件夹已添加到gitignore中。

 yarn publish dist

Output:
    The following paths are ignored by one of your .gitignore files:
    dist/package.json
    Use -f if you really want to add them.
    info Visit https://yarnpkg.com/en/docs/cli/publish for documentation about this command.

如何将dist保留在gitignore中,但要使yarn例外,以便能够将dist文件夹添加到git commit中?

我尝试过:

-。npmignore,不带dist文件夹(->被yarn忽略)

-将文件数组添加到package.json

-还有其他建议吗?

1 个答案:

答案 0 :(得分:0)

我对此的解决方案(我想是更多解决方法),是使用$v_user_id = '350a'; if(is_numeric($v_user_id)) { $stmt = $mysqli->prepare("SELECT * FROM tbl_user WHERE user_id = ? "); $stmt->bind_param('s', $v_user_id); $stmt->execute(); } 选项调用yarn publish,例如

--no-git-tag-version