Skip to content

PreloadPlugin & HtmlWebpackPlugin Multiple Assests Injection on <head> #2644

Open
@kaankucukx

Description

@kaankucukx

Version

3.0.4

Reproduction link

https://github.com/kaankucukx/css.extract.true.reproduction

Node and OS info

v9.8.0

Steps to reproduce

npm i

npm run serve

inspect page with chrome browser

check

Multiple as follows.

<link href="/css/app.7115290d.css" rel="preload" as="style">

<link href="/css/app.7115290d.css" rel="stylesheet">

What is expected?

Only one injection is mandatory per asset for rendering/loading performance.

With both preload and without will make page load render blocking.

What is actually happening?

Simply add extract = true for css extraction and PreloadPlugin or HtmlWebpackPlugin injects Duplicate assets to one with

rel="preload" as="style"

and without

rel="stylesheet"


Probably this will also brake up on MiniCssExtractPlugin involved to this scenario, where code splitting available for css files. Should care for this also.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions