我有一个典型的含mofosa脚本的mofosa前端项目。我希望某个变量(api路径)具有不同的值,具体取决于构建配置文件(dev或prod)。我如何在含羞草中实现这一点?我想要什么如何将变量传递给咖啡文件,具体取决于mimosa中的构建配置文件
例子:
prod.coffee:
exports.api = 'myserver'
dev.coffee:
exports.api = 'localhost'
api-accessor.coffee
config = getCurrentConfig(); # this is the part I do not know how to implement
exports.getStuff =() ->
# here I want config.api to have different values depending on build profile
$.ajax config.api + 'getStuff'