是否可以将“index.coffee”文件挂接到 Yeoman 生成器的入口点?
“generator-generator”生成器创建一个“index.js”文件。将其替换为“index.coffee”会向 Yeoman 隐藏生成器。
我查看了文档,但没有找到任何提及它的内容。
https://github.com/yeoman/yeoman/wiki/Generators
我发现了一个非常古老的 Yeoman 分支,它似乎有这样的计划:
https://github.com/mklabs/yeoman/wiki/generators
目前我已经设置了一个观察程序,将我的 CoffeeScript 文件编译为 JavaScript。
最佳答案
您希望您的 index.js
文件包含以下内容:
require('coffee-script');
module.exports = require('./index.coffee');
然后将实际的生成器代码放入 index.coffee
中。我从此处的生成器-生成器移植了示例 https://gist.github.com/tuxracer/6332601
关于coffeescript - Yeoman 生成器 CoffeeScript 入口点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17728360/