-
Notifications
You must be signed in to change notification settings - Fork 16
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
Error when trying to minify a js that is over 100KB #94
Comments
Does the compact false option change anything other than the size limit? |
Research I did indicate that version of babel used in this extension limits the file size to 100KB and latest version has this limit set to 500KB. Official documentation says that option "compact" defaults to "auto" which has the following effect: |
Would the 500kb limit be sufficient for you if I just update the library? |
Yes it would be sufficient for now. Would appreciate that |
I'm trying to get a new version out, but I am getting errors trying to update the node_modules... I'm getting errors from node-gyp compiling node-sass. Is anyone able to rebuild the node_module.7z file using the build.cmd file? // I may have to drop node_sass support if I cannot get this working |
I couldnt do anything about babel version itself so I went with my initial idea of adding an option. This option doesnt do much at all so I don't see a reason why not to implement it (https://babeljs.io/docs/options#compact). In this PR I also changed old referencing scheme (from net4.8 to net48). It caused me some issues specifically when building i had 4 folders instead of 3 (net4.8 with just .dll files, net48 with only .exe file, netcoreapp3.1 with .dll files, netstandart2.1 with .dll files). |
@IgnacyPawlak Thanks, I'll take a look at your PR as soon as I can; I tried fixing the referencing scheme in the past, but every time I changed it from net4.8 to net48, it messed up the nuget package... If you could break this up into two PR's it would be easier; one for the babel option and one for the referencing scheme. |
When trying to minify a js that is over 100KB there is a warning from babel:
Warning [BABEL] Note: The code generator has deoptimised the styling of "path/to/file" as it exceeds the max of "100KB".
Even though its a warning, it prevents from starting an application.
To Reproduce
Steps to reproduce the behavior:
Create a js file that is over 100KB
Minify
Add to minify on build
See error
Expected behavior
There should be babel option in config that allows to change compact property to false
Additional context
It is an easy fix (Done it myself locally).
Steps to fix:
in BabelOptions.cs add:
[JsonProperty("compact")] public bool Compact { get; set; }
in BabelCompiler.cs ConstructArguments method add:
if (!options.Compact) arguments += " --compact false";
The text was updated successfully, but these errors were encountered: