Reputation: 11069
In my app (Asp.net mvc) I have the following folder structure:
Scripts
folder contains all .js
and .coffee
files. Inside the folder Controllers
I have a folder for each controller.
I need that whenever a .coffee
file changed, a new file .js
is created in the same folder with the same name.
module.exports = (grunt) ->
# Configurações
grunt.initConfig
coffee:
compile:
options:
basePath: 'Scripts'
preserve_dirs: true
files: 'Scripts/*.js': 'Scripts/**/*.coffee'
# Plugins
grunt.loadNpmTasks 'grunt-contrib-coffee'
When I run grunt: grunt coffee
the following error occurs:
Unable to write "Scripts/*.js" file (Error code: ENOENT). Use --force to continue
Upvotes: 3
Views: 2175
Reputation: 14434
use it that way:
coffee:
compile:
files: [
expand: true
cwd: "./Scripts"
src: ["**/*.coffee"]
dest: "./Scripts"
ext: ".js"
]
read more about it here: http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically
Upvotes: 11