Pregunta

I want to use Google Closure Compiler(GCC further) for joining my js-files and compressing before deploy. It's ok, if I will need to run some script. But how can I write a file with options for GCC? I can only write a *.sh file with task.

Help me please. Also it will be great, if there is some tool, that can watch for changes in my local js folder and run that task.

Thanks.

¿Fue útil?

Solución

  1. There are lots of "make" systems that provide a command to rebuild your software according to a set of rules when one of the source files changes. GNU/Linux has make, Java has ant, CoffeeScript has cake, Ruby has rake, etc. Any of these can spawn a task that will compile your .js files. They all have fiddly syntax.

  2. A system that detects file changes and automatically rebuilds, tests, and deploys everything when files change is called a "continuous build", "continuous integration", or "continuous deployment" system. The big one is Jenkins developed for Java.

It sounds like you want a fairly simple single-user combination of 1 and 2.

node.js is well-suited to running a job that watches for file changes and spawns build commands. It doesn't have a "standard" JavaScript build system or continuous integration system. But there are lots of projects out there, such as

  • ready.js
  • drip for node.js got a lot of coverage but I'm not sure its status.
  • the CoffeeScript language (that compiles into JavaScript) has a Cakefile system that can watch for script changes and run commands

I'm trying to decide between ready.js and Cakefile myself.

Otros consejos

check out plovr. http://plovr.com/

You need to get node.js so you can write make files in javascript , that's the best way to do it.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top