Skip to content
This repository

config paths not created #142

Open
robdodson opened this Issue · 3 comments

4 participants

Rob Dodson sntx Jae Eric di Domenico
Rob Dodson
{
    "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
sntx commented

I'm having the same problem...

Jae
Jae commented

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.

Eric di Domenico

Has anyone figured this out yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.