kongaraju
kongaraju

Reputation: 9606

Requirejs Optimizer r.js not working with node

I am trying to build my project with r.js requirejs plugin but I am not able to get generated output file. compiling successfully.

build.js

({
    baseUrl: ".",
    paths : {
        plugins : "lib",
        underscore : "lib/underscore-min",
        backbone : "lib/backbone-min",
        text : "lib/text",

    },
    mainConfigFile:"app",
    name: "app",
    out: "akorp-built.js"
})

Directory structure

project
 |
 |--js
 |   |--lib
 |   |--modules
 |   |--app.js
 |   |--require-jquery.js
 |   |--build.js
 |
 |--css
r.js

Command

node r.js -o project/js/build.js

compiling but not generating output file.

I tried this, I wonder compiled without 'build.js' file in directory

 node r.js -o build.js

Is anything wrong on my side?

Upvotes: 3

Views: 3362

Answers (1)

Tomas Kirda
Tomas Kirda

Reputation: 8413

Move r.js to the same directory as build.js. Then make sure current directory in the command line is set to that directory. If it's on windows, just call:

cd /d %~dp0
node r.js -o build.js
PAUSE

Upvotes: 1

Related Questions