首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >grunt.js ember-模板-编译器不工作

grunt.js ember-模板-编译器不工作
EN

Stack Overflow用户
提问于 2015-08-07 22:50:59
回答 1查看 267关注 0票数 1

我有grunt-ember-templates插件,它曾经工作过。但是我做了一个npm install,结果搞砸了。现在它不能编译。

错误是这样的:

代码语言:javascript
复制
Running "watch" task
Waiting...
>> File "resources\hbs\index\module.hbs" changed.
Running "emberTemplates:compile" (emberTemplates) task
>> ReferenceError: ember-template-compiler.js:22258
>>   module.exports = Ember.__loader.require("ember-template-compiler");
>>   ^
>> module is not defined
Warning: Ember Handlebars failed to compile resources/hbs/error.hbs. Use --force to continue.

Aborted due to warnings.

我的Gruntfile.js看起来像这样:

代码语言:javascript
复制
module.exports = function(grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        emberTemplates: {
            compile: {
                options: {
                    templateBasePath: /resources\/hbs\//,
                    // Path to the ember-template-compiler of my ember version
                    templateCompilerPath: 'resources/js/libs/ember-template-compiler.js',
                    handlebarsPath: 'node_modules/handlebars/dist/handlebars.js'
                },
                files: {
                    'resources/js/templates.js': 'resources/hbs/**/*.hbs'
                }
            }
        },
...

有什么想法吗?提前谢谢。

EN

回答 1

Stack Overflow用户

发布于 2015-08-10 15:53:18

FWIW,这只是一个依赖问题。修改package.json以包含最新的包修复了它。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31880693

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档