Trying to optimize an requirejs-based project on Windows. Have put the r.js.cmd in the Scripts folder along with the following nodeBuild.js file.
({
baseUrl: ".",
paths: {
jquery: "empty:"
},
name: "main",
out: "main-built.js"
})
When using the command
node r.js.cmd -o nodeBuild.js
I get the following response:
r.js.cmd:1
(function (exports, require, module, __filename, __dirname) { @IF EXIST "%~dp0
^
SyntaxError: Unexpected token ILLEGAL
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
Tried searching for it but can't find similar error description and since it is windows I use the r.js.cmd instead of the r.js. The requirejs main.js file is in the Scripts folder and all other modules is in subdirectories to that.