autoprefixer and webpack use the same browser list config

This commit is contained in:
Mark McDowall 2019-03-05 20:01:21 -08:00
parent b72b74b6c6
commit 6bb649bac5
3 changed files with 10 additions and 15 deletions

6
frontend/browsers.js Normal file
View File

@ -0,0 +1,6 @@
module.exports = [
'>0.25%',
'not ie 11',
'not op_mini all',
'not chrome < 60'
];

View File

@ -5,6 +5,7 @@ const path = require('path');
const webpack = require('webpack');
const errorHandler = require('./helpers/errorHandler');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const browsers = require('../browsers');
const uiFolder = 'UI';
const frontendFolder = path.join(__dirname, '..');
@ -98,12 +99,7 @@ const config = {
loose: true,
debug: false,
useBuiltIns: 'entry',
targets: [
'>0.25%',
'not ie 11',
'not op_mini all',
'not chrome < 60'
]
targets: browsers
}
]
]

View File

@ -1,4 +1,5 @@
const reload = require('require-nocache')(module);
const browsers = require('./browsers');
module.exports = (ctx, configPath, options) => {
const config = {
@ -17,15 +18,7 @@ module.exports = (ctx, configPath, options) => {
'postcss-color-function': {},
'postcss-nested': {},
autoprefixer: {
browsers: [
'Chrome >= 30',
'Firefox >= 30',
'Safari >= 6',
'Edge >= 12',
'Explorer >= 11',
'iOS >= 7',
'Android >= 4.4'
]
browsers
}
}
};