problems loading jasmine using requireJS

Showing 1-3 of 3 messages
problems loading jasmine using requireJS opensas opensas 9/3/12 6:57 PM
I'm giving my first steps with requireJS and I'm trying lo load jasmine with it

I have the following problem

With this code it works ok:
--
  <script type="text/javascript">
    var require = {
      paths: {
        'src':          '..',
        'jasmine':      'lib/jasmine-1.2.0/jasmine.min',
        'jasmine-html': 'lib/jasmine-1.2.0/jasmine-html.min',
        'lib':          '../../lib',
        'jquery':       '../../lib/jquery-1.8.1.min'
      },
      shim: {
        jasmine: {
          deps: ['jquery'],
          exports: 'jasmine'
        },
        'jasmine-html': {
          deps: ['jasmine'],
          exports: 'jasmine-html'
        }
      }
    };
  </script>
  <script src="../../lib/require.js"></script>

--

But if I pass the configuration to a require-main.js file in the same folder, I get the following error:

<script data-main="require-main" src="../../lib/require.js"></script>


Seems like requireJs is ignoring all my paths configuration when using the require-main file...

Here's the repo, in case anybody wants to have a look at it:




Re: [requirejs] problems loading jasmine using requireJS James Burke 9/4/12 5:38 PM
The HTML looks like this:
<script data-main="require-main" src="../../lib/require.js"></script>
<script>
require(['jasmine-html'….
</script>

The data-main load is asynchronous, so that require() call in the HTML
code will run before the config is loaded. It is best to put that
require([]) call in the require-main.js file after the config() call.

James
Re: [requirejs] problems loading jasmine using requireJS opensas opensas 9/5/12 9:47 PM
Thanks a lot, James, you were right


I'm still getting used to everything being fetched asynchronously ;-)

saludos

sas