当我用this.copyTpl复制模板时,yeoman打印代码cacharter的引号而不是引号......这里我在做什么 在index.js
this.dependencies["fontawesome"] = "4.2";
this.dependencies["jQuery"] = "~1.11.1";
this.dependencies["responsive-nav"] = "1.0.34";
this.dependencies["superfish"] = "1.7.5";
this.dep = JSON.stringify(this.dependencies);
console.log(this.dep)
display
{"fontawesome":"4.2","jQuery":"~1.11.1","responsive-nav":"1.0.34","superfish":"1.7.5"}
this.fs.copyTpl(
this.templatePath('_bower.json'),
this.destinationPath(projectPath +'/bower.json'),{
projectName: _.slugify(this.project_name),
dependencies: this.dep
}
);
结果文件
{"fontawesome":"4.2","jQuery":"~1.11.1","responsive-nav":"1.0.34","superfish":"1.7.5"},
为什么会发生这种情况,我需要额外的配置?我错过了什么?谢谢你的帮助