避免 Yeoman 生成器中的冲突 [英] Avoid conflicts in Yeoman generator

查看:36
本文介绍了避免 Yeoman 生成器中的冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用 Yeoman 搭建脚手架时,我想用模板替换我应用中的部分内容.一切似乎都很好,但我在脚手架期间遇到了这个冲突错误.

I'd like to replace a partial in my app with a template when scaffolding with Yeoman. Everything seems to work out fine, but I get this conflict error during the scaffold.

<代码>这个模板('条件文件/html/_signup.email.html', 'app/html/partials/_main.signup.html');

<代码>冲突应用程序/html/partials/_main.signup.html[?] 覆盖 app/html/partials/_main.signup.html?(Ynaxdh)

有没有办法避免这种情况?我考虑过传递一个 {status: 'force'} 但这似乎没有用.

Is there a way to avoid this? I looked into passing a {status: 'force'} but that didn't seem to work.

推荐答案

我可以看到几个选项:1. 您可以将 --force 作为选项传递给您的 yo 命令:yo mygenerator --force2.可以在调用模板函数前设置generator.conflicter.force = true

A couple of options I can see: 1. You can pass --force as an option to your yo command: yo mygenerator --force 2. can set generator.conflicter.force = true before calling the template function

这篇关于避免 Yeoman 生成器中的冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆