fite-plugin-autoprefixer/index.js

20 lines
411 B
JavaScript
Raw Permalink Normal View History

2024-07-25 16:42:09 +08:00
/**
* {}
* @author yutent<yutent.io@gmail.com>
* @date 2024/07/25 16:39:23
*/
import autoprefixer from 'autoprefixer'
import postcss from 'postcss'
export default function (browers = 'chrome 89, safari 13.1') {
return function (ext, data) {
if (ext === 'css') {
return postcss([autoprefixer(browers)])
.process(data, { from: '' })
.then(r => r.css)
}
return data
}
}