本文介绍了如何在angular中使用postcss / autoprefixer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已阅读问题

有关如何使用postcss / autoprefixer的信息,我还是很陌生。

on how to use postcss/autoprefixer I am still really unlcear.

我只是 npm install autoprefixer吗? --save-dev
这是正确的方法吗?

Do I just npm install autoprefixer --save-devIs this the right way of doing it?

我也阅读了postcss / autoprefixer文档仍然不知道如何处理

I have also read the postcss/autoprefixer docs I still do not understand how to go about

请协助,谢谢

更新
与SCSS一起使用,脚本将运行

UpdateUsing with SCSS, the script runs

postcss --parser postcss-scss -u autoprefixer --autoprefixer.browsers \"last 2 versions\" -r src/**/*.scss


推荐答案

我已将** postcss postcss-cli autoprefixer *安装为开发依赖项

I have installed the **postcss postcss-cli autoprefixer* as dev dependencies

npm install --save-dev postcss postcss-cli autoprefixer

然后创建一个npm脚本来运行postcss cli d这样的自动前缀

And then create a npm script to run the postcss cli and auto prefixer like so

"script": {
  ...
   "prefixcss": "postcss -u autoprefixer --autoprefixer.browsers 'last 2 versions' -r src/**/*.css",
  ...
}

然后在重建之前运行脚本

And then ran the script before I rebuilt

 npm run prefixcss

这篇关于如何在angular中使用postcss / autoprefixer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 00:49