How do I use postcss/autoprefixer in angular

2019-04-13 00:32发布

I have read through the issue #1521

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

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

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

Please assist, thanks

1条回答
相关推荐>>
2楼-- · 2019-04-13 01:22

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

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

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
查看更多
登录 后发表回答