簡體   English   中英

如何更改 Angular CLI 項目中的 Autoprefixer 選項?

[英]How to change Autoprefixer options in Angular CLI project?

我試圖在我的 Angular2 CLI 項目中使用 grid css,但是我收到以下消息:

autoprefixer: IE supports only grid-row with / and span. You should add grid: false option to Autoprefixer and use some JS grid polyfill for full spec support

我查看了https://github.com/postcss/autoprefixer ,它解釋了如何在 gulp 文件中設置此選項,但是我不確定在 Angular 項目中的哪個位置可以配置它。

目前無法將選項傳遞給 angular-cli 1.0 中的 autoprefixer( 問題評論)。

有兩個選項可以解決此問題。

您可以有選擇地禁用單個規則的內部前綴:

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

您還可以使用ng eject ( docs ) 輸出 angular 應用程序的webpack配置並對其進行修改。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM