I am trying to load some js files with require. Here is my config file:
define(function() {
"use strict";
require.config({
hbs : {
templateExtension : 'hbs',
disableHelpers: true,
disableI18n : true
},
shim: {
'underscore': {
exports: '_'
},
'backbone': {
deps: [
'underscore',
'jquery'
],
exports: 'Backbone'
},
json2 : {
exports: "JSON"
},
'jqueryMockAjax': {
exports: '$.mockjax',
deps: ['jquery']
}
},
paths: {
jquery: 'libs/jquery/jquery',
jqueryMockAjax: 'libs/jquery-mockjax/jquery.mockjax',
underscore: 'libs/underscore/underscore',
backbone: 'libs/backbone/backbone',
handlebars : 'libs/hbs/handlebars',
text: 'libs/text/text',
hbs: 'libs/hbs/hbs',
i18nprecompile : 'libs/i18nprecompile',
json2 : 'libs/json2/json2'
}
});
});
As you can see my js vendor files are located in my libs
directory. My directory structure looks like this:
+project
+app
+js
+libs
app.js
main.js
Most of my dependencies are loading like they should, like jquery
and underscore
, but the handlebars stuff is not loading like it should. For example, I have a path to handlebars.js
as libs/handlebars/handlebars
and it is removing the libs
part of the path. With other files it is not. Here is my network tab showing what gets pulled in and what doesnt.
You can see the libs
part of the path being removed. I dont know what that means. Any help will be appreciated.