I want to add on to this.
I am also developing a plugin for JWebSockets.
I have the same problem.
When I minify the script during export, I get errors.
I have also investigated this in detail, and I found that by minifying, some of the JavaScript identifiers were changed.
For example, one of the identifer was "usersList" and it was changed to "-"
At present I am developing the plugin so testing without minify is ok. But it will be a problem when I want to actually deploy it.