Questions tagged [grunt-contrib-coffee]

Compile CoffeeScript files to JavaScript.

Grunt task to compile CoffeeScript files to JavaScript.

17 questions
10
votes
4 answers

How can I use grunt-contrib-watch and grunt-contrib-coffee to compile CoffeeScript only as needed?

I'd like to run coffee lint and coffee compile on only the single file that I'm saving. There are hundreds of CoffeeScript files in my project, and compiling all of them takes too much time. Here's my Gruntfile: module.exports = (grunt) -> …
4
votes
2 answers

Creating grunt tasks for compiling coffeescript files recursively inside directories and subdirectories

I am trying to create a grunt task to compile coffeescript code spread across multiple files to .js files of the same name. I have the grunt coffeescript plugin and I am looking to use the "glob_to_multiple" spec that is given on this…
EternallyCurious
  • 2,345
  • 7
  • 47
  • 78
2
votes
1 answer

Does Coffeescript always use ES6 Template Literals when compiling instances of string interpolation?

If you use string interpolation in Coffeescript... # source.coffee bar = "Bar" console.log "Foo #{bar}" It compiles to # compiled.js var bar = 'Bar'; console.log(`Foo ${bar}`); What version of Coffeescript started started compiling string…
rb-
  • 2,315
  • 29
  • 41
2
votes
1 answer

Compiling coffeescript files with grunt

I am trying to write a grunt task to compile numerous .coffee files to corresponding .js files and .map files using grunt. I have the grunt coffee plugin, but there are some problems: It compiles all files into one common destination folder instead…
EternallyCurious
  • 2,345
  • 7
  • 47
  • 78
1
vote
1 answer

How to set up gruntfile so compiled files go on same directory as their source

I'm working on a really old project that used Grunt 0.3 and Coffee, and I need to update it to newer versions of both, but I'm not particularly familiar to Grunt. Previously, Grunt would compile the .js files to the exact same folder and name of…
1
vote
1 answer

Coffeescript source map doesn’t reference original files, but a new concated file

I’m using grunt-contrib-coffee to compile the following: src coffee test1.coffee test2.coffee test3.coffee into: dist js concated.js concated.js.map This works, but the problem is that a third file is generated in dist/js called…
1
vote
1 answer

Coffeescript if else doesnt work

I am using coffeescript with grunt and am trying to only include JS files file pattern "*.min.js". Somehow my test is failing though and all files get included. So my if statement always returns true. How do I make this work? getJsDependencies = -> …
Tim Hysniu
  • 1,446
  • 13
  • 24
1
vote
1 answer

Target using grunt-contrib-coffee

I'm using grunt-contrib-coffee in an AngularJS project and I'm trying to set configuration options based on grunt's target. I have the following configuration file (using grunt-load-options): 'use strict'; module.exports = function(grunt) { …
Marcos Chicote
  • 315
  • 2
  • 11
1
vote
1 answer

Grunt glob -- can we only copy only what is changed and keep the file structure?

This question, I believe, can be applied to a variety of grunt tasks. I will use grunt-contrib-coffee in my example. I have a dev directory with a complex file structure and a bunch of coffee files. When developing, I use this coffee task to copy…
dezman
  • 18,087
  • 10
  • 53
  • 91
0
votes
1 answer

Using Grunt to watch all files in my src directory and output to build

I'm completely new to Grunt and I want to use it in my next project. What I want to do is, for example, to have the file at src/server.coffee to be compiled to build/server.js and the file at src/public/assets/css/global.less to be compiled to…
0
votes
1 answer

Continuously complinig and running my coffeescript tests with karma

I'm using grunt, karma (singleRun: false). My tests are written in coffeescript. Each time my coffee file changes I want my tests to run. The problem is that I don't know how to make both happens. So far I discovered the watch task, I tried to add…
0
votes
1 answer

Grunt coffee multiple tasks?

So, I have a project with a layout of src --library ----a.coffee ----b.coffee ----c.coffee --demo ----main.coffee I have grunt set up currently to compile coffeescript in src/library to intermediate/library, concat the results to…
0
votes
1 answer

Move from Grunt to Gulp

I’m using grunt to build coffee script and less files in my project. Now I want to move to gulp… but I’m facing some problems. In my grunt file if a global object containing the paths to all my source and destination directories. Each Tasks is using…
musium
  • 2,942
  • 3
  • 34
  • 67
0
votes
1 answer

How to compile all scripts in their own directories with Grunt Coffee?

This is what I currently have: coffee: { options: { bare: true }, glob_to_multiple: { expand: true, flatten: false, cwd: 'public/js', src:…
Joren
  • 9,623
  • 19
  • 63
  • 104
0
votes
1 answer

grunt watch changes and restart coffee

I'm setting up a Gruntfile in which I'm trying to: Compile some coffeescript to javascript for client side. Watch for changes to the coffeescript that is to be compiled to javascript for clientside. Watch for changes to the backend (server)…
gratz
  • 1,506
  • 3
  • 16
  • 34
1
2