如何在Angular CLI项目中更改Autoprefixer选项?

3
我正在尝试在我的Angular2 CLI项目中使用Grid CSS,但是我收到了以下信息:
autoprefixer: IE仅支持带有/和span的grid-row。您应该将grid:false选项添加到Autoprefixer中,并使用一些JS grid polyfill来支持完整规范
我看了一下https://github.com/postcss/autoprefixer,它解释了如何在gulp文件中设置此选项,但是我不确定在Angular项目中可以从哪里进行配置。
1个回答

2

目前在angular-cli 1.0中无法向autoprefixer传递选项(参见问题评论)。

有两种解决方法。

您可以选择性地在单个规则内禁用前缀:

.grid-row {    
  /* autoprefixer: off */
  grid-row-start: 1;
  grid-row-end: 2;
  // ... other IE-incompatible configuration
}

您还可以使用 ng eject (文档) 将您的 angular 应用程序的 webpack 配置输出并进行修改。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接