如何排除文件

时间:2014-06-25 02:29:17

标签: extjs sencha-architect sencha-cmd

在Sencha Architect中使用CMD我已经能够构建我的应用程序的生产版本。但是我似乎无法弄清楚如何从构建过程中排除js文件。我不想用app.js编译它我希望它作为index.html中的单独脚本包含 - 所以cmd基本上不应该触摸它。

Sencha Arhitech生成并调用build.xml,调用build-impl.xml调用init-impl.xml

我读过的所有地方,他们都说要包含以下内容;

<target name="-before-init">
    <echo>Setting build.operations...</echo>
    <echo>app.dir=${app.dir}</echo>
    <property name="build.operations">
        exclude
            -file=\resources\js\version.js
    </property>
</target>

然而,它拒绝排除文件......我可以看到回声,所以我知道它击中目标..

有什么想法吗?这是我应该如何排除文件?

app.framework.version = 4.2.1.883 app.cmd.version = 4.0.4.84

2 个答案:

答案 0 :(得分:0)

事实证明,直到Sencha Architect 3.1

才能做到这一点

答案 1 :(得分:0)

Steps by which i was able to exclude AppConfig file in production build. 
Here file exclude means it will not be compressed/bundled and  variable/properties of this file could be used any where in the app. 

1. Config file(AppConfig.js in our case) MUST be inside resources fodler.  Below are the contents of our AppConfig file

/////////////IxDetect is my Application Namespace///////////////////
var IxDetect = IxDetect || {};

IxDetect.AppConfig = {
    logoPath: '',
    logoTitle: 'Internal',
    pentahoUrl: 'http://107.20.104.150/pentaho',
   pentahoRptCube: 'TrafficWithFraudIndex'
};
////////////////////////////////

2. Link this file in index.html page like below
<script src="resources/AppConfig.js"></script>

3. Add one more item in "js" array in "app.json" file

"js": [
        {
            "path": "resources/AppConfig.js", // This is my file. Also make a sure you do not miss bundle and includeInBundle property
            "bundle": false, 
            "includeInBundle": true
        },
        {
            "path": "app.js",
            "bundle": true
        }
],

4. Try development and production build all should work file

Note: All above changes are done and tested on 6.2(Framework/CMD)