Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: How to generate JS source map?

    Success! Looks like we've fixed this one. According to our records the fix was applied for SDKTOOLS-564 in 6.0.0.92.
  1. #1
    Ext JS Premium Member
    Join Date
    Dec 2009
    Posts
    65
    Vote Rating
    4
      2  

    Question How to generate JS source map?

    Hello,

    it is possible to generate a source map using the closure compiler, e.g.

    Code:
    java -jar compiler.jar \
        --js script.js \
        --create_source_map ./script-min.js.map \
        --source_map_format=V3 \
        --js_output_file script-min.js
    If I use sencha compile concat, or sencha fs minify, how can I do it? How do I pass those additional options (--create_source_map & --source_map_format) to the closure compiler?

    Also, when I try to run the command above using the closure compiler packaged with Sencha Cmd, I get an error:

    Failed to load Main-Class manifest attribute from closure-compiler-r2388.jar

    Thanks,
    Alex.

  2. #2
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Vote Rating
    255
      0  

    Default

    While it's not possible to pass closure-specific args via Cmd today there is a feature request open for that internally: SDKTOOLS-564

  3. #3
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    35
    Vote Rating
    2
      0  

    Default

    I'd like to add a vote for this feature. There is currently no way to tell closure to keep the "use strict" pragma when compressing with Sencha Cmd (yui has no such switch).

    Is there a way to output an uncompressed all-classes.js with Cmd 3.1.2 like you can in the old SDK? That way we could minify ourselves in a separate step.

    Edit: Adding the following with a blank value to sencha.cfg seems to do it:

    build.compression=

  4. #4
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Vote Rating
    255
      0  

    Default

    Alternatively you can do 'sencha app build testing' and it'll create a non-compressed all-classes.js file for you in a 'testing' build folder which you can copy over to production - if you don't want to edit the cfg file.

    You can also do:
    sencha ant -Dbuild.compression.yui=0 -Dbuild.compression.closure=0 -Dbuild.compression.uglify=0 -Dbuild.optimize= build

    But... if it were me I'd just do the 'testing' thing and copy the file - but there you go - three options.

  5. #5
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    35
    Vote Rating
    2
      0  

    Default

    Quote Originally Posted by slemmon View Post
    You can also do:
    sencha ant -Dbuild.compression.yui=0 -Dbuild.compression.closure=0 -Dbuild.compression.uglify=0 -Dbuild.optimize= build
    Thanks for the info!

    Do you know if / when the uglify option will be wired up in Sencha Cmd? (it currently throws "Not Yet Implemented")

  6. #6
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Vote Rating
    255
      0  

    Default

    Uglify is a placeholder for the time being. Implementation is still TBD.

  7. #7
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    35
    Vote Rating
    2
      0  

    Default

    Is uglify implemented in Sencha Cmd 5? I notice the config stub is still there...

  8. #8
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    803
    Vote Rating
    62
      0  

    Default

    Any news on source map generation ?
    Github https://github.com/vadimpopa
    Blogging @ : http://vadimpopa.com
    Twitter: @vadimvpopa

  9. #9
    Sencha Premium User
    Join Date
    Nov 2009
    Posts
    149
    Vote Rating
    9
      -1  

    Default

    bump

  10. #10
    Sencha User
    Join Date
    Mar 2012
    Posts
    137
    Vote Rating
    3
      0  

    Default

    I'd also really appreciate the possibility to create javascript source maps for a number of obvious reasons.

    Please give us some information if this is at least discussed/planed for future versions...

    Thanks

Page 1 of 3 123 LastLast

Tags for this Thread

Posting Permissions

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