RequireJs Optimization on Windows fails

前端 未结 2 522
南方客
南方客 2021-01-23 20:00

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: \".         


        
2条回答
  •  误落风尘
    2021-01-23 20:15

    Based on the documentation it seems to me that the equivalent of a *nix:

    r.js -o nodeBuild.js
    

    would be on Windows:

    r.js.cmd -o nodeBuild.js
    

    That is, don't pass it to Node but let Windows run it. r.js.cmd is a Windows command file, which Node cannot interpret. When you do it like you've shown in your question, Node tries to interpret that file and fails.

提交回复
热议问题