caolan / jam

JavaScript package manager - using a browser-focused and RequireJS compatible repository
MIT License
1.5k stars 105 forks source link

config paths not created #142

Open robdodson opened 11 years ago

robdodson commented 11 years ago
{
    "name": "my-project",
    "version": "0.0.1",
    "description": "My example project",
    "jam": {
        "baseUrl": "public",
        "packageDir": "public/vendor",
        "dependencies": {
            "jquery": "1.7.x",
            "underscore": null
        },
        "config": {
          "paths": {
            "templates": "public/templates"
          }
        }
    }
}

When I put the above into a package.json and jam install I get a require.config.js file which has entries for jquery and underscore but it doesn't create a path for templates.

var jam = {
    "packages": [
        {
            "name": "jquery",
            "location": "vendor/jquery",
            "main": "jquery.js"
        },
        {
            "name": "underscore",
            "location": "vendor/underscore",
            "main": "underscore.js"
        }
    ],
    "version": "0.2.17",
    "shim": {
        "underscore": {
            "exports": "_"
        }
    }
};

if (typeof require !== "undefined" && require.config) {
    require.config({
    "packages": [
        {
            "name": "jquery",
            "location": "vendor/jquery",
            "main": "jquery.js"
        },
        {
            "name": "underscore",
            "location": "vendor/underscore",
            "main": "underscore.js"
        }
    ],
    "shim": {
        "underscore": {
            "exports": "_"
        }
    }
});
}
else {
    var require = {
    "packages": [
        {
            "name": "jquery",
            "location": "vendor/jquery",
            "main": "jquery.js"
        },
        {
            "name": "underscore",
            "location": "vendor/underscore",
            "main": "underscore.js"
        }
    ],
    "shim": {
        "underscore": {
            "exports": "_"
        }
    }
};
}

if (typeof exports !== "undefined" && typeof module !== "undefined") {
    module.exports = jam;
}
sntx commented 11 years ago

I'm having the same problem...

Jae commented 11 years ago

yes me too, none of the config is passed through to requirejs....

not sure if that's intended feature

you can easily have requirejs.config({...}) in your main app.js and use Jam to manage external dependencies?

however it's not very clear from documentation for integration between Jam and Require.js

Also baseUrl property under jam is also confusing as it's got nothing to do with baseUrl property for requirejs config.

qwertme commented 10 years ago

Has anyone figured this out yet?