2017-09-14 6 views
1

ember-index addを使用してindex.htmlではなくindex.jspファイルを生成しようとしています。 ember-indexアドオンをインストールし、必要な変更も加えました。Ember-indexがindex.jspを生成していません

config/environment.jsファイルが

/* eslint-env node */ 

'use strict'; 

module.exports = function(environment) { 
    let ENV = { 
    modulePrefix: 'user-profile', 
    output: 'index.jsp', 
    environment, 
    rootURL: '/', 
    locationType: 'hash', 
    EmberENV: { 
     FEATURES: { 
     // Here you can enable experimental features on an ember canary build 
     // e.g. 'with-controller': true 
     }, 
     EXTEND_PROTOTYPES: { 
     // Prevent Ember Data from overriding Date.parse. 
     Date: false 
     } 
    }, 
    'ember-index': { 
     output: 'index.jsp', 
     content: { 
      file: 'example.txt', 
      includeInOutput: true, 
      includeInIndexHtml: false 
     } 
    }, 

    APP: { 
     // Here you can pass flags/options to your application instance 
     // when it is created 
    } 
    }; 
return ENV; 
}; 

はまた、私example.txtファイルが

<meta content="Example"> 
<h2>html to jsp</h2> 

、最終的に私のindex.htmlに、私は以下を追加しているように見えるの下には今

{{content-for 'ember-index'}} 

しかし、スニペットのように見えます私はember buとemberプロジェクトを構築しようとしていますild私のdistフォルダにindex.jspファイルを見ることができません。

答えて

0

新しいアプリケーションでは、このアドオンは期待どおりに動作します。新しいEmberアプリを使用して最小限の例の手順を実行すると、あなたが逃したものが見つかります。

index.jspの正しい場所を探していますか? ember buildの実行後にdist/export/index.jspにあります。

index.htmlにタグを追加するのを忘れましたか?私の知る限り、我々は輸出と出力フォルダを提供する場合、エクスポートフォルダが作成されますが、私はのようなものを指定していない知っているよう

<!-- app/index.html --> 
<!DOCTYPE html> 
<html> 
    <head> 
    ... 
    {{content-for 'ember-index-1'}} 
    {{content-for 'ember-index-2'}} 
    </head> 
    <body> 
     ... 
    </body> 
</html> 
+0

:Readmeには、使用するファイルのために、彼らは次のように指定しなければならないことを指定しますそれでは、正しい場所にcontent-forタグを用意しても、index.jspファイルを取得できませんでした。 –

+0

新しいアドバイスを作成して設定を比較することをお勧めします。それでも問題が解決しない場合は、おそらくアドオンの問題を開いてください。私はこれを自分で使ったことはありません。がんばろう! – handlebears

関連する問題