| 1 |
import postcss from 'postcss' |
| 2 |
import autoprefixer from 'autoprefixer' |
| 3 |
|
| 4 |
export default { |
| 5 |
process: (css, processOptions, pluginOptions) => { |
| 6 |
|
| 7 |
|
| 8 |
var result = postcss([autoprefixer(pluginOptions)]).process(css, processOptions) |
| 9 |
|
| 10 |
var warns = result.warnings().map(function (i) { |
| 11 |
delete i.plugin |
| 12 |
return i.toString() |
| 13 |
}) |
| 14 |
|
| 15 |
var map = result.map ? result.map.toString() : null |
| 16 |
return { css: result.css, map: map, warnings: warns } |
| 17 |
}, |
| 18 |
|
| 19 |
info: (options) => { |
| 20 |
return autoprefixer(options).info() |
| 21 |
} |
| 22 |
} |