Results 1 to 3 of 3

Thread: Strip whitespace with sencha cmd without using compression

  1. #1
    Ext JS Premium Member
    Join Date
    Aug 2011
    Location
    Greenville, SC
    Posts
    172
    Vote Rating
    16
      0  

    Default Strip whitespace with sencha cmd without using compression

    Does anyone know if it is possible to strip just whitespace with sencha cmd? We would like to just strip out whitespace without using yui or closures.

    Bryan

  2. #2
    Sencha - Documentation Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,162
    Vote Rating
    257
      2  

    Default

    When building using 'sencha app build' you can modify the appFolder/.sencha/app/production.properties build file to have no compression or optimization like this:

    Code:
    build.compression.yui=0
    build.compression.closure=0
    build.compression.uglify=0
    
    
    build.options.debug=debug:false
    
    
    # This property can be modified to tune the optimization process
    # build.optimize=\
    #         optimize\n \
    #             -define-rewrite\n
    build.optimize=
    
    
    build.css.preprocess=true                                                                 
    build.css.preprocessor.opts=
    build.css.compress=true
    If you don't want to modify the properties.build and instead would prefer to pass properties in the build statement instead you can do "sencha ant -p build.optimize=,build.compression.yui=0 build" instead of 'sencha app build'.

    That takes care of half of the equation - next you'll need to call the ant target x-strip-js from the app's build.xml file.

    You can add the following to strip the whitespace from all-classes.js and output to a new file.

    Code:
    <target name="-after-build">
        <x-strip-js srcFile="${build.dir}/all-classes.js" outfile="${build.dir}/all-classes-no-whitespace.js" blockcomments="false" linecomments="false" whitespcae="true"/>
    </target>
    *Note, the spelling of 'whitespcae' is intentional - currently there is a misspelling of that arg in the source java file.

  3. #3
    Ext JS Premium Member
    Join Date
    Aug 2011
    Location
    Greenville, SC
    Posts
    172
    Vote Rating
    16
      0  

    Default

    Slemmon,
    Thanks for the response. I thought I was going mad because it was documented and not working!

    Bryan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •