UglifyJS-online
UglifyJS-online copied to clipboard
Browser hangs on large files
Should probably utilise a Web Worker to perform the minification in a separate thread.
I've done some experimenting on my own minifier-in-a-browser (https://github.com/tom-sherman/yet-another-js-online-minifier)
Turns out that only some of the freeze up is caused by the minification, the rest is caused by just pasting large amounts of text into an input.
In my version, I solved the freezing issue completely by doing two things:
- Offload the minification to a worker. I used
terserfor minification but should work just as well with uglify. - Use CodeMirror for the input
CodeMirror sidesteps the paste-jank by virtualising all of the code lines and only rendering to the DOM those that are on screen.
Sorry for the late reply. This seems like a great idea. If you'd like to submit a pull request, I'd be happy to merge it.