Vue-loader: Discussion: extractCSS, Webpack 4, extract-text-webpack-plugin and mini-css-extract-plugin

Created on 20 Mar 2018  路  6Comments  路  Source: vuejs/vue-loader

What problem does this feature solve?

There is currently a bit of uncertainty regarding the future of extract-text-webpack-plugin and sokraj's mini-css-extract-plugin. Unfortunately despite this plugin being one of the most commonly recommended plugins for Webpack, the transition for this plugin hasn't been handled very well (no blame being placed on anyone, that's just how things are). However, in the context of vue-loader, the extractCSS property is a hard dependency on extract-text-webpack-plugin, and I did not see any discussion regarding how this is going to be handled in the future so I'd recommend having this discussion sooner rather than later.

For some additional context, there is an existing discussion https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/749

What does the proposed API look like?

Don't have any recommendations here... except maybe have extractCSS take a loader.

Most helpful comment

In v15 we will simply deprecate extractCSS since the configuration will be done in normal webpack config instead of in vue-loader's own options. It will work with both WETP and the new MCEP (in fact it's already tested here).

For v14, we'll likely have to keep it as-is.

All 6 comments

In v15 we will simply deprecate extractCSS since the configuration will be done in normal webpack config instead of in vue-loader's own options. It will work with both WETP and the new MCEP (in fact it's already tested here).

For v14, we'll likely have to keep it as-is.

Great news. Thanks very much for your work @yyx990803

@yyx990803 How will this change impact SSR/critical CSS extraction?

@luisatmaniak no change.

Hey @yyx990803 to me it looked like with the old CSS Extraction we would be able to choose which components we want to extract CSS from by matching component names in the loader settings. I think the that option is gone now or at least deprecated. I'm not sure if thats a good change. Please correct me if I'm wrong.

Hey @yyx990803 to me it looked like with the old CSS Extraction we would be able to choose which components we want to extract CSS from by matching component names in the loader settings. I think the that option is gone now or at least deprecated. I'm not sure if thats a good change. Please correct me if I'm wrong.

Found a soltuion, it can be done using the issuer option in the rule. (if you want to do it manually)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

snoopdouglas picture snoopdouglas  路  3Comments

matt-sanders picture matt-sanders  路  4Comments

frangio picture frangio  路  3Comments

C0deZLee picture C0deZLee  路  3Comments

ryanelian picture ryanelian  路  3Comments