bridgetown
bridgetown copied to clipboard
PostCSS config: turn autoprefixer off by default?
I'm increasingly wary of defaults that account for years-old browsers as they result in ~~significant~~ size/performance penalties of built assets. Just one example: when autoprefixer is enabled and you add @keyframes
animations to your CSS, every single one gets duplicated with @-webkit-keyframes
…yet Safari hasn't needed that since early 2016!
I'd like to look at either turning it off completely by default (aka you'll need to opt-in), or figure out some kind of browserslist default that's more reasonable.
I'm weighing bumping up the default PostCSS stage as well back up to 4 which is what I prefer to use (e.g. I don't want all my CSS variables polyfilled, resulting in massive duplication), but if so I'll file a separate issue.
Actually with gzip compression etc., it doesn't seem to make too much of a difference either way. 8.79kB vs 9.06kB 🤷♂️
you could set browserlists in package.json
to be last 1 version
which may help but if you do I'd suggest adding their upgrade command to the package.json
scripts.
npx browserslist@latest --update-db
@andrewmcodes thanks I'll check that out.
Yes, as an example, Ember uses a config/targets.js file (https://cli.emberjs.com/release/advanced-use/asset-compilation/#jstranspiling), where the project can configure supported browsers. This data is then consumed by CSS and JS pre-processors. Also based on browserlist, which was mentioned above.
Maybe Bridge Town could do something in that direction?
Appreciate the additional reference there @sandstrom
This seems too low of a priority at this point. I'd rather prioritize making PostCSS optional anyway as time goes by…
@jaredcwhite Great that you are simply closing low-priority issues.
Makes the set of actual issues more manageable, and also reflects the reality that there will always be more wishes than time.
More open-source maintainers should do like this! 💯