-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Salsa - should not attempt to digest minified .js files #6675
Comments
Maybe we should have a flag like |
@zhengbli Let's not add any more flags to the compiler unless we need to - there's plenty already. First question is how to detect if a file is minified. One is very consistent and clear - the file ends in Personally I'd prefer not to go via heuristics where possible. Is detecting based on filename sufficient (i.e. how common is it to have minified JavaScript files that don't end in |
On a second thought, this with the previous suggestion that |
Per further discussion, lets just go with ignoring files with ".min." in the name, and we can consider other heuristics if this is not sufficient. Some examples of possible heuristics and where they might give incorrect results:
Perhaps if we're running it through the parser anyway we could count newlines and spaces outside of comments and strings? A more involved change, but maybe an option if the naive name check isn't sufficient. |
who will be doing the filtering? the compiler or the server host? |
It is probably better to do the filtering in the language service. Otherwise the project is different when editing in the editor and compiling from |
fair. |
@billti starting with the ".min.js" pattern makes sense. It doesn't cover webpack archives that look like this I've just tested a project with webpacks and the good news is that Salsa can digest a 1.5MB webpack file, which has caused a crash with our existing JS language service. |
Fixed in #7016. |
@billti Great thanks! We will update our docs to address.
❓ does this change also apply to the tsconfig.json? |
yes. |
Having a minified .js file in the project is almost always a hint that a folder that should be excluded in the jsconfig.json is not excluded.
The text was updated successfully, but these errors were encountered: