Manuel Di Iorio Manuel Di Iorio - 1 year ago 70
Javascript Question

Is there a precompiler for JavaScript like Sass?

Good morning, is there a precompiler solution for JavaScript like Sass for CSS ?

The only features I need are the partials precompiling (to have fewer js files) and the auto-compression of the file.

I googled for Coffeescript but it's not what I'm looking for and because I don't want a different syntax..

If is there a software like Koala for Sass would be appreciated but even from command line (I'm on Windows) is ok, thank you in advance!

PS: with partials I mean:

@import "file.js"

The tool find this and replace it with the content of the file, creating a new file, maybe in another folder specified by me (As I said, like Koala)

Answer Source

Javascript is directly interpreted by your browser so there is no "partials precompiling" stuff.

What you are looking for is a task runner like Gulp or Grunt that can launch a task (amongst others) that will concatenate your files.

Here is a concat task for Gulp

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download