【问题标题】:Why won't my grunt task work - emailBuilder为什么我的繁重任务不起作用 - emailBuilder
【发布时间】:2015-06-02 21:13:52
【问题描述】:

我正在尝试运行一个简单的基本任务,但它不工作。我从这个包中使用 npm install 安装:

{
  "name": "ent-nmo-fasg-younger-mills-em-1",
  "version": "0.1.0",
  "devDependencies": {
    "grunt": "~0.4.5",
    "grunt-contrib-jshint": "~0.10.0",
    "grunt-contrib-nodeunit": "~0.4.1",
    "grunt-contrib-uglify": "~0.5.0",
    "grunt-email-builder": "^3.0.1"
  }
}

然后在我的 Gruntfile.js 中添加了以下代码:

module.exports = function(grunt) {
	grunt.initConfi({
		pkg: grunt.file.readJSON('package.json'),
		emailBuilder: {
		  files : [{
			  expand: true,
			  src: ['dev/*.html'],
			  dest: 'dist/',
			}]
		}
	});
	
	grunt.loadNpmTasks('grunt-email-builder');
	
	grunt.registerTask('dist',['emailBuilder']);
};

尝试运行“grunt dist”后我在终端中遇到的错误是:

正在加载“Gruntfile.js”任务...错误

TypeError: undefined is not a function 警告:找不到任务“dist”。使用 --force,继续。

【问题讨论】:

    标签: javascript gruntjs


    【解决方案1】:

    我的问题是 grunt 配置中的一个简单拼写错误。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-17
      • 1970-01-01
      • 2013-07-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多