2

r.jsを使用した後、RequireJS、BackboneJS、およびさまざまなライブラリを使用してPhonegapアプリを作成しようとして問題が発生しています。

最適化前はすべて正常に動作しますが、その後、main-build.js で次のエラーが発生します

キャッチされていない TypeError: プロパティ 'View' を読み取れません

以下は私の必要な設定です

require.config({
baseUrl: 'lib',
paths: {
    domReady        :   'require/domReady',
    text            :   'require/text',
    async           :   'require/async',
    jquery          :   'jquery/jquery',
    jqmconfig       :   'jqm/jqm-config',
    jqm             :   'jqm/jquery.mobile',
    underscore      :   'underscore/underscore',
    backbone        :   'backbone/backbone',
    jqmaps          :   'google/jquery.ui.map',
    router          :   '../app/router',
    models          :   '../app/models',
    collections     :   '../app/collections',
    views           :   '../app/views',
    templates       :   '../app/templates',
    app             :   '../app/app'
},
shim: {
    underscore: {
        exports     :   '_'
   },
   backbone: {
       deps         :   ['jquery', 'jqmconfig', 'jqm', 'underscore'],
       exports      :   'Backbone'
  },
  jqmconfig         :   ['jquery'],
  jqm               :   ['jquery','jqmconfig'],
  jqmaps            :   ['jqm']
}});

これが私のブートストラップです

require(
[
    'app', 'domReady', 'jqmconfig'
], 

function(app, domReady){

    domReady(function() {
        // On device ready initialize the app code
    });
});

ここに私のbuild.jsがあります

({
baseUrl: 'lib',
paths: {
    domReady        :   'require/domReady',
    text            :   'require/text',
    async           :   'require/async',
    jquery          :   'jquery/jquery',
    jqmconfig       :   'jqm/jqm-config',
    jqm             :   'jqm/jquery.mobile',
    underscore      :   'underscore/underscore',
    backbone        :   'backbone/backbone',
    jqmaps          :   'google/jquery.ui.map',
    router          :   '../app/router',
    models          :   '../app/models',
    collections     :   '../app/collections',
    views           :   '../app/views',
    templates       :   '../app/templates',
    app             :   '../app/app',
    main            :   '../app/main', 
},
name: 'main',
out: 'app/main-build.js'})

明らかに明白なことはありますか?

お時間をいただきありがとうございます。

4

1 に答える 1