postcss-preset-env

CSS 兼容不用版本早期的浏览器。

PostCSS Preset Env lets you convert modern CSS into something most browsers can understand, determining the polyfills you need based on your targeted browsers or runtime environments.

https://github.com/csstools/postcss-plugins

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
const postcssPresetEnv = require('postcss-preset-env');

const yourConfig = {
	plugins: [
		/* other plugins */
		/* remove autoprefixer if you had it here, it's part of postcss-preset-env */
		postcssPresetEnv({
			/* pluginOptions */
			features: {},
		})
	]
}