Skip to content

Error during build when minifing js over 100KB #500

Open
@IgnacyPawlak

Description

@IgnacyPawlak

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:

  1. Create a js file that is over 100KB
  2. Minify
  3. Add to minify on build
  4. 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";

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions