Extended "overrideBrowserslist" option to support environment maps (#37642)

This commit is contained in:
Slava Fomin II 2019-08-19 21:17:00 +03:00 committed by Sheetal Nandi
parent 35ea72f220
commit a5200306f9
2 changed files with 24 additions and 3 deletions

View File

@ -16,5 +16,22 @@ const ap2: Transformer = autoprefixer({
flexbox: true,
grid: false,
stats: {},
ignoreUnknownVersions: false
ignoreUnknownVersions: false,
});
// Using environment map in "overrideBrowserslist"
const ap3: Transformer = autoprefixer({
overrideBrowserslist: {
production: [
'> 1%',
'ie 10',
],
modern: [
'last 1 chrome version',
'last 1 firefox version',
],
ssr: [
'node 12',
],
},
});

View File

@ -1,6 +1,8 @@
// Type definitions for autoprefixer 9.6
// Project: https://github.com/postcss/autoprefixer
// Definitions by: Armando Meziat <https://github.com/odnamrataizem>, murt <https://github.com/murt>
// Definitions by: Armando Meziat <https://github.com/odnamrataizem>
// murt <https://github.com/murt>
// Slava Fomin II <https://github.com/slavafomin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.7
@ -8,6 +10,8 @@ import { Plugin } from 'postcss';
import { Stats } from 'browserslist';
declare namespace autoprefixer {
type BrowserslistTarget = (string | string[] | { [key: string]: string[]; });
interface Options {
env?: string;
cascade?: boolean;
@ -18,7 +22,7 @@ declare namespace autoprefixer {
grid?: false | 'autoplace' | 'no-autoplace';
stats?: Stats;
browsers?: string[] | string;
overrideBrowserslist?: string[] | string;
overrideBrowserslist?: BrowserslistTarget;
ignoreUnknownVersions?: boolean;
}