gruntjs / grunt-contrib-requirejs

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

passing dependencies as an array variable doesn't work #88

Closed laggingreflex closed 10 years ago

laggingreflex commented 10 years ago

Following works like it should:

require(['jquery', 'angular', 'controller'], function($, angular) {...

It looks for jquery in the correct path as specified in path alias. ('/lib/jquery/jquery' etc)

This doesn't work:

var require_dependencies = ['jquery', 'angular', 'controller'];
require(require_dependencies, function($, angular) {...

This makes requests for http://localhost/jquery (which doesn't exist), essentially disregarding my path aliases.

I'm guessing that either grunt task (or requireJS optimizer) doesn't resolve the array variable require_dependencies before outputting.

sindresorhus commented 10 years ago

This task is just a thin wrapper for RJS. Try opening a ticket there instead.