angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Autoprefixer support

Open AlexDede opened this issue 10 years ago • 45 comments

Please, can you add support to process CSS files with autoprefixer in webpack configs?

AlexDede avatar Aug 01 '16 19:08 AlexDede

...and PostCSS in general. CssNext is awfully tempting, given that we're already knee-deep in transpilation and forward-compatibility here :-)

wulfsberg avatar Aug 04 '16 20:08 wulfsberg

  • cssnext and cssnano are a must have.
  • configure custom options for them.

https://github.com/angular/angular-cli/issues/1656

herkulano avatar Aug 28 '16 10:08 herkulano

I would love this too.

Kunepro avatar Aug 29 '16 15:08 Kunepro

Definitely waiting for this

caroso1222 avatar Sep 03 '16 07:09 caroso1222

I need this too

gperdomor avatar Sep 07 '16 20:09 gperdomor

👍

mchambaud avatar Sep 08 '16 19:09 mchambaud

As a cssnext user, the ability to specify postcss plugins would go a long way to solving my use cases for #1656.

Autoprefixer in particular is kind of a must-have...

SethDavenport avatar Sep 14 '16 21:09 SethDavenport

Also waiting for this. Last step before we finally switching to the CLI. Our App uses a flexbox layout which is a nightmare to use without autoprefixer / cssnext.

Tre665 avatar Sep 16 '16 09:09 Tre665

Could this be achieved by altering packages/angular-cli/models/webpack-config.ts to optionally merge an arbitrary webpack config that the developer could specify in the root of their project? This would not only solve the postcss processors configuration requirement, but allow for any other tweaks to the webpack configuration.

euangoddard avatar Sep 16 '16 10:09 euangoddard

I'm trying to use Foundation Sites as my front end framework, and it requires an autoprefixer. Some way to support one in my build is therefore essential. So, I'd like to request that the priority of this issue be adjusted up. Thanks!

ptrhvns avatar Sep 22 '16 17:09 ptrhvns

I don't think this is only a "nice to have" as browser prefixing is an issue in allmost every project.

https://medium.com/@Ai_boy/configure-angular-2-cli-webpack-beta-14-5a7052ce6156#.3m4w3c6j5

mbeckenbach avatar Sep 28 '16 15:09 mbeckenbach

This is a duplicate of 1656, and angular team already stated that they won't work on this until 2017, or later.

They consider AOT more important, I don't agree, at all. I feel that being in the condition to work on my project is more important than some performance increase, but apparently angulat-cli team doesn't agree. The most annoying part is that I always had autoprefixer before they decided to move to webpack. I welcome webpack, but angular-cli stubbornness to face that they are causing problems to a wide portion of angular-cli community, with people leaving for other seeds is disconcerting.

I don't want to change seed, as I believe that in the long run angular-cli will be the best solution, but I'm unhappy with angular-cli team's priorities.

Seskara avatar Sep 28 '16 16:09 Seskara

Is there any workaround to get autoprefixer work on angular-cli? I'm not that fluent with webpack but perhaps we can do something about it and implement some unofficial solution. Would it be that hard? Sorry I'm hugely ignorant.

caroso1222 avatar Sep 28 '16 17:09 caroso1222

@caroso1222 check @mbeckenbach link (2 post above yours).

Kunepro avatar Sep 28 '16 17:09 Kunepro

@Seskara both features are important. But i agree with you, performance optimization is not the most important one. Most apps at the moment should be still in development. So the development tools are much more important for now.

mbeckenbach avatar Sep 29 '16 05:09 mbeckenbach

@Seskara This is not quite a duplicate of #1656. I still have some hope that since this is not about configuring webpack and messing with the entire build system, but configuring a plugin which is already included and running, we can get this before a generic, all-singing, all-dancing webpack override system.

(ETA just to add: I think the focus on AoT compilation is a question of adoption. They need to prove that Angular can easily provide very lean and efficient apps, to convince people to adopt it. Promising that such optimization will come is good enough for us who are already here, believing in the project, but for people evaluating the market, it's just so much handwaving. So I can see why they consider it critical, even though I've been harping on about getting PostCSS support).

wulfsberg avatar Sep 29 '16 09:09 wulfsberg

@wulfsberg Fair point regarding the AoT compilation. Maybe I don't care that much about it is because bandwidth was never a problem in my projects. :-)

mbeckenbach avatar Sep 29 '16 13:09 mbeckenbach

Somebody has this: https://medium.com/@Ai_boy/configure-angular-2-cli-webpack-beta-14-5a7052ce6156#.3m4w3c6j5 working with beta.16? I get an error (see comment in the article).

Kunepro avatar Sep 30 '16 10:09 Kunepro

How is autoprefixer a nice to have? Every production project I've seen in the last 4 years has autoprefixing, making a production application without it is barbaric, do we go back to mixins, yuck? ES6 is arguably more of a nice to have at least, writing in ES5 isn't going to break the rendering of your site in certain browsers.

scottwio avatar Sep 30 '16 21:09 scottwio

If anyone wants to take a stab at a PR that adds this functionality, I'll be happy to review it.

Bear in mind that the PR should not aim at offering configurable functionality, but rather base functionality. If it needs to be configured on a project by project basis, then it'll need to wait for the addon system.

filipesilva avatar Oct 08 '16 23:10 filipesilva