Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Minified Function Name Lookup?

Discussion in 'WebGL' started by bdev, Feb 29, 2016.

  1. bdev

    bdev

    Joined:
    Jan 4, 2011
    Posts:
    656
    Is there such a thing that would let me resolve what the minified function names are? The issue is that I have one function i know as "Ijt" that can spin for seconds at times during my game, but a developer build barely runs at all and requires a lot of changes to my s3 upload process that i'd like to avoid making.. So is there any sort of lookup file generated when unity compiles the project?
     
  2. Eric-Laberge

    Eric-Laberge

    Joined:
    Jan 20, 2011
    Posts:
    26
    Edit your ProjectSettings.asset file, and look for the "WebGL::emscriptenArgs:" line
    Change that line so it reads "WebGL::emscriptenArgs: --emit-symbol-map" (notice the space before the dashes)

    Next time you launch a build, look in the Temp/StagingArea/Data folder for the "<projectName>.js.symbols", you'll find what you need :p

    It would really be nice if Unity could expose this feature ;)
     
    bdev likes this.
  3. bdev

    bdev

    Joined:
    Jan 4, 2011
    Posts:
    656
    Thank you so much for this.
     
  4. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Unity 5.4 will always set this flag by default (because we will start analyzing generated symbols internally to generate a report on where the build size goes).
     
  5. bdev

    bdev

    Joined:
    Jan 4, 2011
    Posts:
    656
    It would be nice to have some sort of option to extend arguments too jonas. my args looks like this
    Code (csharp):
    1. -s EXPORTED_FUNCTIONS="['_main','_SendMessageInt','_SendMessageFloat','_SendMessageString','_SendMessage','_SetFullscreen','_bblpny_bgm_init','_bblpny_bgm_ctor','_bblpny_bgm_dtor','_bblpny_bgm_proc','_bblpny_bgm_pcm1','_bblpny_bgm_pcm2','_bblpny_bgm_ivok','_bblpny_bgm_uvok','_bblpny_bgm_dbls','_bblpny_bgm_ndbl','_bblpny_bgm_ints','_bblpny_bgm_nint','_bblpny_bgm_wrds','_bblpny_bgm_nwrd','_bblpny_bgm_flts','_bblpny_bgm_nflt','_bblpny_bgm_bufs','_bblpny_bgm_nbuf','_realloc','_bblpny_http_register','_bblpny_http_deleg','_bblpny_http_mem_alloc','_bblpny_http_mem_free','_bblpny_http_pulse','_malloc','_free',]" --emit-symbol-map
    since i write some of the stuff in C that the jslib references i have to supply EXPORTED_FUNCTIONS this way. and the problem is that whatever i enter overwrites the prior value unity places on the command line.. so i have to check that i've included everything unity places in EXPORTED_FUNCTIONS.