【发布时间】:2019-07-14 07:00:45
【问题描述】:
我正在使用 PostCSS,我想添加 Post-uncss。我不使用任务运行器,只使用 Postcss-cli。我的 package.json 现在看起来像这样:
"css-clean": "npx postcss src\\css\\main.css -u autoprefixer --replace && npx postcss src\\css\\main.css -u css-declaration-sorter --replace --no-map"
它变得相当长。我看到提到 PostCSS 可以有一个配置文件“postcss.config.js”。文中唯一提到的就是骨架:
module.exports = {
plugins: {
'autoprefixer': {},
'css-declaration-sorter': {}
}
};
uncss 文档只是说选项:
{
html: ['index.html', 'about.html', 'team/*.html'],
ignore: ['.fade']
}
我希望如果有人有使用配置文件的经验,可以提供一些建议,因为我不相信这个功能有很好的文档记录。
【问题讨论】: