2017-09-14 27 views
1

我试图使用ember-index添加来生成index.jsp文件而不是index.html。我已经安装了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'}} 

但现在当我正在尝试用余烬埠来建立余烬项目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

,因为我知道,当我们提供输出文件夹作为出口导出文件夹将被创建,但我没有指定像什么并且是的,我已经在正确的地方提供了content-for标签,但仍然无法获取index.jsp文件。 –

+0

我给你的建议是创建一个新的应用程序并比较配置。如果你仍然有问题,可能会为插件打开一个问题。我自己没有使用过这个。祝你好运! – handlebears