使用grunt-contrib-handlebars版本问题预编译Handlebars

时间:2015-09-05 18:16:37

标签: gruntjs handlebars.js

我刚尝试为grunt和handlebars设置预编译器。我在访问模板时遇到此错误:

Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version (>= 4.0.0) or downgrade your runtime to an older version (>= 2.0.0-beta.1).

有谁知道如何修复它?

1 个答案:

答案 0 :(得分:1)

没关系,我认为Grunt的插件已经过时了。如果我错了,请随意纠正我。

我使用grunt-shell并且只使用shell来编译它们(在使用节点更新把手版本之后)....

shell: {
        options: {
            stderr: false
        },
        handlebars: {
            command: 'node_modules/handlebars/bin/handlebars src/templates/*.handlebars -f dist/js/templates.js'
        }
    },