Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change Autoprefixer options in Angular CLI project?

I am trying to use grid css in my Angular2 CLI project, however I get the following message:

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

I looked at https://github.com/postcss/autoprefixer which explains how to set this option in a gulp file, however I'm not sure where in the Angular project I can configure this.

like image 275
Red Riding Hood Avatar asked Feb 02 '26 02:02

Red Riding Hood


1 Answers

It is currently not possible to pass options to autoprefixer in angular-cli 1.0 (issue comment).

There are two options to fix the problem.

You can selectively disable prefixing inside for a single rule:

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

You can also use ng eject (docs) to output the webpack config of your angular application and modify it.

like image 91
fourcube Avatar answered Feb 04 '26 15:02

fourcube



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!