Use the special "empty:" path setting instead of excludes..
paths : {
"user_data" : "empty:"
}
More info:
http://requirejs.org/docs/optimization.html#empty From: itodd <t...@adimab.com>
Reply-To: <requirejs@googlegroups.com>
Date: Fri, 30 Mar 2012 12:09:20 -0700 (PDT)
To: <requirejs@googlegroups.com>
Subject: [requirejs] Excluding inline define when optimizing?
I may be doing this the wrong way (I would welcome suggestions on the best
way for bootstrapping my scripts with user-specific data). I have a define
statement that sets some user_data in my main page:
<script>
define('user_data',{
...
});
</script>
My scripts can import this data using define('user_data',function(user_data)
{});. This has worked for development. I'm having trouble optimizing:
$ r.js -o build.js
...
Error evaluating module "undefined" at location
"/Users/boland/Projects/..../static/js/build/user_data.js"
...
I have tried adding exclude:['user_data'] and excludeShallow:['user_data']
to my build file (under modules and as a top level attr but haven't been
able overcome this error. Any suggestions?
Thanks,
--
Todd