Skip to content

[Feature Request] Add an option "onDemandLoading" #711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cbazureau opened this issue Feb 25, 2021 · 2 comments
Closed

[Feature Request] Add an option "onDemandLoading" #711

cbazureau opened this issue Feb 25, 2021 · 2 comments

Comments

@cbazureau
Copy link
Contributor

cbazureau commented Feb 25, 2021

  • Operating System: All
  • Node Version: All
  • NPM Version: All
  • webpack Version: 4/5
  • mini-css-extract-plugin Version: 1.3.8

Feature Proposal

The goal is to add an option onDemandLoading (true by default) to be able to desactivate On-Demand-Loading mini-css-extract-plugin implementation

This package does two things :

This plugin extracts CSS into separate files. It creates a CSS file per JS file which contains CSS. It supports On-Demand-Loading of CSS and SourceMaps. https://webpack.js.org/plugins/mini-css-extract-plugin/

In some case/project the second part is not needed because it's covered by another plugin or specific code (in our case we have an asyncComponent loader that takes care of js/css/rtl-css parallel loading.

If onDemandLoading is false the lines from https://github.com/webpack-contrib/mini-css-extract-plugin/blob/master/src/index.js#L568 to https://github.com/webpack-contrib/mini-css-extract-plugin/blob/master/src/index.js#L1060 will be simply ignored.

Feature Use Case

SSR stack with its own asyncComponent loader that loads itself .js/.css/.rtl.css

If this feature is accepted, i will push a pull request that does the job...

@alexander-akait
Copy link
Member

alexander-akait commented Feb 25, 2021

Sorry, out of scope mini-css-extract-plugin

In some case/project the second part is not needed because it's covered by another plugin or specific code (in our case we have an asyncComponent loader that takes care of js/css/rtl-css parallel loading.

Just don't extract them

@alexander-akait
Copy link
Member

Also it is unsafe, because order can be wrong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants