-
Couldn't load subscription status.
- Fork 2.4k
Closed
Milestone
Description
Hello @jrburke,
I'm using Backbone from the master branch because I want some of the fixes and I noticed that now Backbone supports AMD.
Everything is working fine while using require.js to load the dependencies but when I optimize and get out of it a single file with r.js (I'm using grunt-contrib-requirejs which uses requirejs 2.1.0), I get the following error "Uncaught ReferenceError: Backbone is not defined backbone.marionette.js:37
(anonymous function)".
The configuration given to requirejs for the build is the following:
requirejs.config({
shim: {
'zepto': {
exports: 'Zepto'
},
'zepto-touch': {
exports: 'Zepto',
deps: ['zepto']
},
'iscroll': {
exports: 'IScroll'
},
'marionette' : {
deps : ['zepto', 'underscore', 'backbone', 'deferred-installed'],
exports : 'Marionette'
},
'underscore': {
exports: '_'
},
'deferred': {
deps: ['zepto'],
exports: 'Deferred'
}
},
paths: {
requireLib : '../bower_components/requirejs/require',
i18nprecompile: '../bower_components/require-handlebars-plugin/hbs/i18nprecompile',
json2 :'../bower_components/require-handlebars-plugin/hbs/json2',
hbs : '../bower_components/require-handlebars-plugin/hbs',
handlebars : '../bower_components/require-handlebars-plugin/Handlebars',
async: '../bower_components/requirejs-plugins/src/async',
zepto: '../bower_components/zepto/zepto',
iscroll: '../bower_components/iscroll/build/iscroll',
underscore: '../bower_components/underscore/underscore',
backbone: '../bower_components/backbone/backbone',
marionette: '../bower_components/marionette/lib/backbone.marionette',
deferred: '../bower_components/simply-deferred/deferred',
path : 'vendors/path'
},
hbs: {
disableI18n: true,
disableHelpers: true
},
map : {
'backbone': {
'jquery': 'zepto'
}
},
include : [
'requireLib'
]
});For the grunt task for requirejs I configured like that:
requirejs : {
dev : {
options : {
baseUrl : '<%= yeoman.app %>/scripts/',
mainConfigFile : '<%= yeoman.app %>/scripts/main.js',
out : '<%= yeoman.dist %>/scripts/main.js',
name : 'main',
findNestedDependencies: true,
generateSourceMaps : true,
optimize: 'uglify2',
done: checkRjsBuild
}
}
}Anything that I'm missing? Thank you very much
Metadata
Metadata
Assignees
Labels
No labels