gruntjs / grunt-contrib-requirejs

Optimize RequireJS projects using r.js.
http://gruntjs.com/
MIT License
504 stars 105 forks source link

Paths fallback not supported in optimizer? #26

Closed asuh closed 11 years ago

asuh commented 11 years ago

I am running the Yeoman Beta 7, having installed require.js using the Webapp scaffolding. I am currently having build issues trying to build using Grunt. This has been tested for both Windows and Mac using Beta 7 and the same problem happens on both.

I have updated the require.config function:

require.config({
    paths: {
        jquery: [
            // jQuery Fallback - http://requirejs.org/docs/api.html#pathsfallbacks
            '//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min',
            // If the CDN location fails, load from this location
            '../bower_components/jquery/jquery'
        ],
        bootstrap: 'vendor/bootstrap'
    },
    shim: {
        bootstrap: {
            deps: ['jquery'],
            exports: 'jquery'
        }
    }
});

When I am in the directory and run "grunt" in the Terminal, when it gets to the requirejs:dist step, I receive the following error:

[Error: Error: paths fallback not supported in optimizer. Please provide a build config path override for jquery
    at /Users/myaccount/Sites/test/node_modules/grunt-contrib-requirejs/node_modules/requirejs/bin/r.js:24325:23
]

Is there an error in the way I've formatted the path fallback?

tkellen commented 11 years ago

That error is coming directly from the r.js compiler--you'll need to open an issue there. Sorry!

asuh commented 11 years ago

@tkellen If it's coming directly from r.js, where would you suggest I submit the issue?

tkellen commented 11 years ago

https://github.com/jrburke/r.js

asuh commented 11 years ago

Here's my confusion, this issue was already created and closed by him. https://github.com/jrburke/requirejs/issues/791

franz-josef-kaiser commented 11 years ago

https://github.com/jrburke/requirejs/issues/791