0

I'm using Web Compiler for Visual Studio 2015, and I'm trying to compile a coffeescript file into a normal javascript file, but whenever I compile the coffeescript.js file I get the javascript.js, but with:

// Generated by IcedCoffeeScript 108.0.11
(function() {
var iced;

iced = require('iced-runtime');
...

appended to the beginning. We don't use Node.js, so the require() fails and hence my AngularJS controller is unrecognized.

Is there a setting within Web Compiler that disables the insertion of the above? I just want the coffeescript compiled into normal JS.

Jimenemex
  • 3,104
  • 3
  • 24
  • 56

1 Answers1

1

The Web Compiler seems to be using the IcedCoffeeScript compiler, with the --runtime flag defaulting to node, causing the require you see.

You should have a compilerconfig.json at the project root. Try setting an explicit option for the runtime:

compilers: {
  coffeescript: {
    runtimeMode: 'inline' // or 'window' or even 'none'
  }
}
vijoc
  • 683
  • 8
  • 17
  • This is correct, but as an FYI for others. Web Compiler defaults to use the icedcoffeescript compiler which introduces [flaws](https://github.com/madskristensen/WebCompiler/issues/202) in some situations. I have since excluded it from my project. – Jimenemex Aug 29 '18 at 13:18