I am having trouble getting text! plugin to work on my requirejs website. It always includes lib / in the request url, however all other files (without using text!) Were successfully found and uploaded. Here is my directory structure:
WebContent/
|
|
|
|
|
|
|
|
|
my index.html file:
<body>
<div id="siteLayoutContainer"></div>
<script data-main='config/config' src="lib/require.js"></script>
</body>
Configuration file:
requirejs.config({
baseUrl: './',
paths: {
jquery: 'lib/jquery.js',
backbone: 'lib/backbone.js',
text: 'lib/text',
application: 'backbone/application'
},
text: {
env: 'xhr'
}
});
require(['application'], function(App) {
App.start();
});
I use text! the plugin looks like this:
define([
'jquery',
'text!backbone/templates/SomeTemplate.html'
], function(jQuery, NotFoundHtml) {
}
So, in the above script, the template uses the URL:
http: //localhost/lib/backbone/templates/SomeTemplate.html
and I expect it to be:
http: //localhost/backbone/templates/SomeTemplate.html
I tried the following:
- text.js require.js WebContent
.
! ,
lib/ , html
.
.
- baseUrl - .
- config.js index.html script,
require.js script - .
- , , "!../backbone/templates/SomeTemplate.html -
, , . , , , ! baseUrl URL-, .