I have a simple Grunt file written in Coffeescript:
"use strict"
module.exports = (grunt) ->
config =
src: "app"
dist: "build"
grunt.initConfig =
config: config
copy:
dist:
files: [
expand: true
cwd: "<%= config.app %>"
dest: "<%= config.dist %>"
src: [
"*.{ico,png}"
"{*/}*.html"
]
]
grunt.loadNpmTasks "grunt-contrib-copy"
grunt.registerTask "build", [
"copy:dist"
]
grunt.registerTask "default", [
"build"
]
Which causes the following error on startup:
Verifying property copy.dist exists in config...ERROR
>> Unable to process task.
Warning: Required config property "copy.dist" missing. Use --force to continue.
What does it mean? Copy.dist seems to be present, so why is it not readable?
Also, I assume this is a Coffeescript formatting issue, because the equivalent Grunt file written in Javascript does not throw this problem:
"use strict";
module.exports = function (grunt) {
var config = {
scr: "app",
dist: "build"
}
grunt.initConfig({
config: config,
copy: {
dist: {
files: [{
expand: true,
cwd: "<%= config.app %>",
dest: "<%= config.dist %>",
src: [
"*.{ico,png}",
"{*/}*.html"
]
}]
}
}
});
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.registerTask("build", [
"copy:dist"
]);
grunt.registerTask("default", [
"build"
]);
};
source
share