If I run the optimizer without the "namespace: 'foo'" flag everything works as expected. When I add "namespace: 'foo'" into the app.build.js I get this error:
GET: file:// (path to the project) /require-jquery/jquery-require-sample/webapp/jquery.js
main-built.js:main-built.js:1839Uncaught Error: Script error http://requirejs.org/docs/errors.html#scripterror
main-built.js:163
I have looked around for a solution but there is little info on using RequireJS optimizer to export a single file, with jquery, and a namespace. Thanks!
I have put the RequireJS + jQuery sample project (with a modified app.build.js and the app.html) on github here.
({
baseUrl: ".",
out: 'main-built.js',
//Comment out the optimize line if you want
//the code minified by UglifyJS
optimize: "none",
paths: {
"jquery": "require-jquery"
},
name: 'main',
namespace: 'foo'
})