Mini-css-extract-plugin: SSR; all extracted CSS is loaded, load on demand not working

Created on 16 Nov 2018  ·  5Comments  ·  Source: webpack-contrib/mini-css-extract-plugin

This is a follow up of issue #90.

I created a simple repository to illustrate the issue.

Please, npm install && npm start, then go to localhost:3000

If you inspect the requested CSS, you can see all of the extracted CSS loaded, which is not the actual desired:

captura de pantalla 2018-11-16 09 12 05

This css contains styles for /about page, even though we are not on the about page:

captura de pantalla 2018-11-16 09 13 02

CSS for /about & /test routes should be lazy loaded once we visit those routes, not before.

The desired behavior is to have this CSS loaded only when visiting the correct routes and not before.

Most helpful comment

@evilebottnawi I cant remove vue-loader, if I do, none of my setup makes sense, as its a fully vue project and all the files are vue files.

All 5 comments

@Avcajaraville can you create simple example, without vue-loader? Looks problem not related to plugin directly.

@evilebottnawi I cant remove vue-loader, if I do, none of my setup makes sense, as its a fully vue project and all the files are vue files.

Hi @evilebottnawi,

Any update about this issue?

Can't reproduce only one CSS was loaded, I think it was bug in vue-loader or something else
Screenshot from 2021-02-18 18-13-15

Also related https://github.com/nuxt/nuxt.js/issues/3943

Thanks for your support and interest @alexander-akait

Was this page helpful?
0 / 5 - 0 ratings