2016-03-21 8 views
1

定義が定義されていない、それは私のコンソールR.js(require.js)原因にReferenceError:私はしかし<code>r.js -o build.js</code></p> <p>によってrequire.jsプロジェクトを作成

inline

define('hbs/underscore',[],function() {

上の例外を提供します

ここで生成されたapp.min.js

https://gist.github.com/poc7667/ecf36474b68799ebb29d

です

問題を解決するにはどんな考えですか?私は私に共通mismatch例外

HTML

 <script type="text/javascript" src="js/app.min.js" ></script> 

build.js

{ 
    name: "app.main.js", 
    mainConfigFile: 'app.main.js', 
    out: "./app.min.js", 
    optimize: 'none', 
    wrap: true, 
    include: [ 'app.main' ], 
    insertRequire: ["app.main"], 
} 

app.main.js

を与えるであろう、オプション wrap: trueは、他のスクリプトと競合を避けるためにある使用します
requirejs.config({ 
    paths: { 
     jquery: './vendor/js/jquery-2.1.1.min', 
     underscore: './vendor/js/underscore-min', 
     backbone: './vendor/js/backbone-min', 
     json2: './vendor/js/hbs/hbs/json2', 
     hbs: './vendor/js/hbs/hbs', 
     handlebars: './vendor/js/handlebars-v4.0.5', 
     text: './vendor/js/text', 
    }, 
    hbs: { // optional 
     helpers: true,   // default: true 
     templateExtension: 'hbs', // default: 'hbs' 
     partialsUrl: ''   // default: '' 
    }, 

    shim: { 
     handlebars: { 
      exports: 'Handlebars' 
     }, 
     backbone: { 
      deps: [ 
       'underscore', 
       'jquery' 
      ], 
      exports: 'Backbone' 
     }, 
     underscore: { 
      exports: '_' 
     }, 
     'jquery': { 
      'exports' : '$' 
     } 
    }, 

}); 

require(["require", "app"],function(Req, App){ 
    $("#sample_app_comments_plugin").hide(); 
    $('head').append('<link rel="stylesheet" href='+cfg.css_style_link+' type="text/css" />'); 
    return App.initialize(); 


}); 

hbs.js

define(['hbs/handlebars', 'hbs/underscore', 'hbs/json2'], function (Handlebars, _, JSON) { 
     function precompile(string, _unused, options) { 
     var ast, environment; 
    .... 

答えて

関連する問題