RequireJs Optimization on Windows fails

前端 未结 2 448
南方客
南方客 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.

    0 讨论(0)
  • 2021-01-23 20:16

    Don't run it through node.

    r.js.cmd -o nodeBuild.js
    
    0 讨论(0)
提交回复
热议问题