thanpolas / grunt-closure-tools

Google Closure Tools for grunt
MIT License
95 stars 22 forks source link

ClosureCompiler no longer works - jit and load-config #70

Closed cristian-sima closed 8 years ago

cristian-sima commented 8 years ago

Hi. I have used it for months and today it is not working. It stops with this message

image

image

thanpolas commented 8 years ago

hmmm there is no error message that would help here, it just aborts :/

cristian-sima commented 8 years ago

@thanpolas Why?

thanpolas commented 8 years ago

try to run the command with the debug option like so:

grunt build --debug --verbose

cristian-sima commented 8 years ago

What is build ?

thanpolas commented 8 years ago

whatever your task is, i don't know how you call it, i can't see from the screenshot

cristian-sima commented 8 years ago

same

image

cristian-sima commented 8 years ago

Gruntfile.js

/* minifyOnSave:false */
/*global module:false, require */
module.exports = function (grunt) {

  // load just the ones which we need
  require('jit-grunt')(grunt);

  // measures the time each task takes
  require('time-grunt')(grunt);

  // load grunt config
  require('load-grunt-config')(grunt, {
    jitGrunt: true
  });
};

And I have a file in the grunt folder called closureCompiler.js which contains this:

module.exports = {
  options: {
    compilerFile: 'W:/Developer/compiler.jar'
  },
  compilerOpts: {
    warning_level: 'verbose'
  },
  preCommit: {
    options: {
      checkModified: true,
    },
    files: [{
      expand: true,
      src: [
        'static/js/**/*.js',
        '!static/js/**/*.min.js'
      ],
      ext: '.min.js'
    }]
  }
}
thanpolas commented 8 years ago

I'm sorry, I still can't tell what's wrong, there's no error or stack trace to indicate something...

What changed since the last time it was working? Is it working on your colleagues?

cristian-sima commented 8 years ago

A lot of Windows 10 updates

cristian-sima commented 8 years ago

It is just me working on this. Yesterday it was working fine

cristian-sima commented 8 years ago

Hi.

I figured out the situation the problem occurs:

  require('load-grunt-config')(grunt, {
     jitGrunt: true
  });

It appears that closureCompiler is the only task that has this problem.

Can someone make something for this?

cristian-sima commented 8 years ago

I got the solution!

You have to tell jit that closureCompiler belongs to this package, using static mapping

  require('jit-grunt')(grunt, {
    closureCompiler: "grunt-closure-tools"
  });