Search code examples
javascriptwebstorm

JavaScript js file too large - crashing WebStorm


I'm trying to include a JavaScript library in my Cordova project in WebStorm, but every time I include the JS file it crashes. Also, when I try to open the file in Sublime it barely works - there are probably hundreds of thousands of lines of JavaScript in the file.

Here it is

How can I get this library to play nicely?


Solution

  • thing 1

    Change you code inspection settings. With smaller files, you can leave on all sorts of inspections you never really use; not so with large files. (hint: right-click the guy-with-a-hat icon in IntelliJ products)

    thing 2

    Tune your VM options to give it more memory. (this link will get you started)

    thing 3

    Obviously, I am obligated to try to talk you into refactoring the single, massive file into smaller js files. I know from experience that this isn't always practical, so I'm going to assume you've already tried that and decided it's not in the project's best interest.