GithubHelp home page GithubHelp logo

--why and custom webpack config about size-limit HOT 10 OPEN

ai avatar ai commented on June 19, 2024
--why and custom webpack config

from size-limit.

Comments (10)

bcullman avatar bcullman commented on June 19, 2024

Wondering if this is the same issue:

When we create a custom config, --why appears to be ignored.

from size-limit.

ai avatar ai commented on June 19, 2024

Yeap, we do not have good UI explain that we do not support --why for custom configs.

Just use Webpack Bundle Analyzer manually.

from size-limit.

bcullman avatar bcullman commented on June 19, 2024

ok, then one question:

When I configure bundle analyzer manually, size-limit switches from reporting package as the gzipped value to the parsed sized value.

How can I get size-limit to report the gzipped value when using a custom Webpack Bundle Analyzer config?

from size-limit.

ai avatar ai commented on June 19, 2024

You need two configs. One you will use to build app and in Size Limit. The second will use Webpack Bundle Analyzer.

from size-limit.

bcullman avatar bcullman commented on June 19, 2024

The problem i am having is that size limit fails if my build include sass files. So I need a custom config for size limit. I believe I want to set...

[
  {
    config: "path/to/my/config/webpack.config.sizeLimit.js",
    gzip: true
  }
]

...but it is not honoring this value.

when I dont specify a config, the reported size in the console was the gzip size (around 45K)
when i specify a config, the reported size in the console switches to the parsed size around (around 550K)

I can see in bundle analyzer both have been computed (and are correct). I just want size-limit to continue to report in the console the gzip size.

from size-limit.

ai avatar ai commented on June 19, 2024

I have a better option for you. If you have big webpck application it will be better to use webpack: false and just call Size Limit after webpack built bundles:

https://github.com/ai/size-limit#usage-for-applications-and-big-libraries

from size-limit.

FezVrasta avatar FezVrasta commented on June 19, 2024

Is there any chance to support --why on create-react-app?

from size-limit.

ai avatar ai commented on June 19, 2024

You can try manually add Webpack Bundle Analyzer to CRA

from size-limit.

FezVrasta avatar FezVrasta commented on June 19, 2024

Not really. You can't edit CRA config

from size-limit.

ai avatar ai commented on June 19, 2024

Sorry. Seems like CRA is not the best thing. It will help if we will force CRA to more to sharec (when it will be stabilized) to be able to change configs.

from size-limit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.