From 6d37bf30c3ac2356601098a522677b25c62c3d0a Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Wed, 2 Oct 2019 11:34:55 +0200 Subject: [PATCH] #111 Seperate browserlist for modern builds --- gulpfile.js | 9 ++++++--- package.json | 20 +++++++++++++++++--- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 9337a0b..a4193a4 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -69,7 +69,9 @@ function style() { // Calculate size before autoprefixing .pipe(bytediff.start()) // autoprefix - .pipe(postcss([autoprefixer()])) + .pipe(postcss([autoprefixer({ + env: "legacy" + })])) // Write the amount gained by autoprefixing .pipe(bytediff.stop(data => formatByteMessage('autoprefixer', data))) .pipe(excludeModern.restore) @@ -79,8 +81,9 @@ function style() { // Calculate size before autoprefixing .pipe(bytediff.start()) // autoprefix modern builds - // TODO: Use separate browserslist to only apply prefixes needed in *modern* browsers - .pipe(postcss([autoprefixer()])) + .pipe(postcss([autoprefixer({ + env: "modern" + })])) // Write the amount gained by autoprefixing .pipe(bytediff.stop(data => formatByteMessage('autoprefixer', data))) .pipe(excludeLegacy.restore) diff --git a/package.json b/package.json index c9515a1..fb6a92e 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,21 @@ "postcss-import": "^12.0.1", "postcss-inline-svg": "^3.1.1" }, - "browserslist": [ - "defaults AND not android 4.4.3" - ] + "browserslist": { + "legacy": ["defaults AND not android 4.4.3"], + "modern": [ + "Edge > 16", + "Firefox > 31", + "Chrome > 49", + "Safari > 9.1", + "Opera > 36", + "ios_saf > 9.3", + "Android > 76", + "OperaMobile > 46", + "ChromeAndroid > 76", + "FirefoxAndroid > 68", + "UCAndroid > 12.12", + "Samsung > 5" + ] + } }