Giter VIP home page Giter VIP logo

Comments (8)

ai avatar ai commented on August 17, 2024 1

Oh. I am too drunk right now 😅 Will explain it with examples tomorrow.

from pwa.

ai avatar ai commented on August 17, 2024 1

Awesome. I like new integration 😍.

from pwa.

lukeed avatar lukeed commented on August 17, 2024

Thanks 👌

  1. I didn't know optimize-css-assets plugin accepted a browsers list. That's good to know and should add it right away

  2. I definitely want to read from existing browserslist config locations, which replace the contents of config.browsers array. However, I would aim to maintain the config.browsers option until it's completely clearly not an option anymore. At this point, the 1.0 can introduce that breaking change outright.


If it weren't for the fact that config.browsers takes a function, which can dynamically change its value in response to X, I'd be all in favor of just using the existing locations. However, it's been very convenient for me at work to do something like this:

config.browsers = function (config) {
  return process.env.ELECTRON !== void 0 ? ['electron > 2'] : config;
}

This can't be (easily) done with its static-config-file setup.

from pwa.

lukeed avatar lukeed commented on August 17, 2024

So I just discovered this which I think will do just fine for work projects. 🎉

This means I can get rid of the config.browsers key, scaffold the package.json config by default (for projects with pwa init, and still expose the opts.browsers to any other plugin or preset (or user config).

Working on this now~

from pwa.

ai avatar ai commented on August 17, 2024

Yeap, if you will translate option to env variable, it will work pretty well.

The only problem, it will not with text editors and others cases out of build pipeline. But I think it is OK as short term solution.

from pwa.

lukeed avatar lukeed commented on August 17, 2024

Can you explain your last sentence? Not quite sure I understand, sorry 🙈

from pwa.

ai avatar ai commented on August 17, 2024

@lukeed Browserslist could be used not only by build tools (like cssnano in webpack). But also by plugins for text editors (there is ESLint plugin, which uses Browserslist, ESLint could be run from the text editor). If we will set browsers by BROWSERSLIST env variable it will not affect cases like text editors plugins.

But i it is a rare case. It is OK to use BROWSERSLIST at least as a temporary solution until the major release.

from pwa.

lukeed avatar lukeed commented on August 17, 2024

Ah, got it 😅 Thanks! That won't be a problem for work – this PWA library won't be mutating or relying on the ENV var approach, so no worries there.

Not sure if you've checked out the PR (I don't expect you to), but all the Browserslist integrations are a lot simpler now & will be easier to manage going forward. 👍


Also, thank you so much for all your contributions to the tooling community 🙏 You've had a massive impact & perhaps not enough people realize that. Hope you had a fun night~!

from pwa.

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.