0

Using CMD from within Sencha Architect I've been able to build a production build of my application. However I can not seem to figure out how to exclude a js file from the build process. I don't want it compiled in with app.js I want it as a separate script include in index.html - so cmd shouldn't touch it basically.

Sencha Arhitech generates and calls build.xml which calls build-impl.xml which calls init-impl.xml

Everywhere I've read, they say to include the following;

<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>

However it refuses to exclude the file...I can see the echos so I know it's hitting the target..

Any ideas? Is this how I am supposed to exclude files?

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

JasonF
  • 33
  • 3

2 Answers2

0

Turns out this won't be possible to do until Sencha Architect 3.1

JasonF
  • 33
  • 3
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) 
Sindhu
  • 101
  • 1
  • 3