I am trying to create a grunt task to build a javascript project using requirejs with closure compiler as the optimizer. I am using the grunt-contrib-requirejs plugin.
https://www.npmjs.org/package/grunt-contrib-requirejs
Although I haven't explicitly setup the closure compiler, here is the config and the error:
Config:
requirejs:
compile:
options:
sourceMap: true
baseUrl: "client"
mainConfigFile: "main.js"
name: "main.js"
out: "build/main.js"
optimize: "closure"
#generateSourceMaps: true
closure:
CompilerOptions: {},
CompilationLevel: 'SIMPLE_OPTIMIZATIONS'
loggingLevel: 'WARNING'
Error:
C:\Users\Project>grunt requirejs
Running "requirejs:compile" (requirejs) task
{ [Error: Error: optimizer with name of "closure" not found for this environment
at Object.optimize.js (C:\Users\Project\node_modules\requirejs\bin\r.js:24771:27)
]
originalError: [Error: optimizer with name of "closure" not found for this env
ironment] }
Closure is written in java and my project is in nodejs and I'm not sure how to set it up right.