문제

When using RequireJS without "priority" it works:

require(

  {},

  [
    'js/libs/jquery/jquery-1.4.4.js',
    'js/libs/utils.js',
    'js/app/app.index.js',
    'js/app/app.framework.js',
    'js/app.modules/app.modules.navigation.js'
  ],

  function() {
    require.ready(function() {
      console.log('require is done and dom is ready');
      app.name = 'myApp';
      app.init();
    });   
  }

);

But once i add "priority", it stops working:

require(

  {
    priority: [
      'js/libs/jquery/jquery-1.4.4.js',
      'js/libs/utils.js',
      'js/app/app.blueprint.js',
      'js/app/app.framework.js'
    ]
  },

  [
    'js/libs/jquery/jquery-1.4.4.js',
    'js/libs/utils.js',
    'js/app/app.index.js',
    'js/app/app.framework.js',
    'js/app.modules/app.modules.navigation.js'
  ],

  function() {
    require.ready(function() {
      console.log('require is done and dom is ready');
      app.name = 'myApp';
      app.init();
    });   
  }

);

What am i doing wrong?

p.s. And for anyone wondering why I do not use the RequireJS-jQuery, is a preference thing =]

도움이 되었습니까?

해결책

Okay, so the issue was a small bug in requirejs which James Burke fixed in the latest commit of requirejs: https://github.com/jrburke/requirejs/commit/9be3d7d01db380c1014d9cc393be2762e3c78044

It will go in the next release possibly in the upcoming weeks.

Reference: http://groups.google.com/group/requirejs/browse_thread/thread/4d8f5bce44dff57d

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top