The configuration for browserslist that we use here at K4Connect. This provides autoconfiguration for a variety of projects, including:
@babel/preset-env
-- lets you write ESNext despite your target environment.- Autoprefixer -- lets you forget about vendor prefixes in CSS entirely, freeing you up to use modern CSS without duplicating implementation details in multiple vendor-specific properties
postcss-normalize
-- ensures you have the minimal patches necessary to get consistent CSS behavior between target browserspostcss-preset-env
-- allows you to use modern CSS features (eg: "custom properties", otherwise known as "CSS variables") while maintaining compatibility with all desired targets
Two steps:
npm install --save-dev @k4connect/browserslist-config
- Add this to your
package.json
: * If you are targetting Node:"browerserslist": [ "extends @k4connect/browserslist-config/node.js" ]
* If you are targetting browsers:"browerserslist": [ "extends @k4connect/browserslist-config/browser.js" ]
* If you are targetting React Native, you'll have to research how to configurebrowserslist
properly and then update this repo. Or you could just try the Node one: it'll probably work.