Answer the question
In order to leave comments, you need to log in
Grunt task to build coffeescript file to file
Good afternoon.
I'm trying to figure out how to write a taxi for grunt so that it collects my coffee scripts in the same files, only js.
For example, the structure:
blocks
header
header.coffee
# I want header.js to be here after compilation and I don't want to manually write in gruntfile for each such path file.
That is, I want to collect */*.coffee in the same place as the original coffee.
Answer the question
In order to leave comments, you need to log in
I guess you should use the standard grunt-contrib-coffee with settings like this:
coffee:
main:
expand: true
cwd: "/"
src: ["**/*.coffee"]
dest: "/"
ext: ".js"
I assume node.js and grunt-sli are already installed. Put grunt-contrib-coffee
in the project folder
Create a gruntfile.js with the following content:
module.exports = function(grunt){
grunt.initConfig({
coffee:{
compile:{
files:{
'coffee/script.js' : 'coffee/script.coffee'
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.registerTask('default', 'coffee')
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question