Skip to content

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

@cbazureau

Description

@cbazureau
  • 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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions