jam icon indicating copy to clipboard operation
jam copied to clipboard

config paths not created

Open robdodson opened this issue 12 years ago • 3 comments

{
    "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;
}

robdodson avatar Apr 30 '13 22:04 robdodson

I'm having the same problem...

sntx avatar May 16 '13 20:05 sntx

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.

Jae avatar Jun 02 '13 22:06 Jae

Has anyone figured this out yet?

qwertme avatar Oct 23 '13 03:10 qwertme