2018-11-23 08:04:42 +01:00
|
|
|
const reload = require('require-nocache')(module);
|
2019-04-13 05:25:58 +02:00
|
|
|
const browsers = require('./browsers');
|
2018-11-23 08:04:42 +01:00
|
|
|
|
|
|
|
module.exports = (ctx, configPath, options) => {
|
|
|
|
const config = {
|
|
|
|
plugins: {
|
|
|
|
'postcss-mixins': {
|
|
|
|
mixinsDir: [
|
|
|
|
'frontend/src/Styles/Mixins'
|
|
|
|
]
|
|
|
|
},
|
|
|
|
'postcss-simple-vars': {
|
|
|
|
variables: () =>
|
|
|
|
ctx.options.cssVarsFiles.reduce((acc, vars) => {
|
|
|
|
return Object.assign(acc, reload(vars));
|
|
|
|
}, {})
|
|
|
|
},
|
2018-11-23 08:05:47 +01:00
|
|
|
'postcss-color-function': {},
|
2018-11-23 08:04:42 +01:00
|
|
|
'postcss-nested': {},
|
|
|
|
autoprefixer: {
|
2019-04-13 05:25:58 +02:00
|
|
|
browsers
|
2018-11-23 08:04:42 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
return config;
|
|
|
|
};
|