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

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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With