Skip to content

[Bug: plugin-legacy] legacy js inserts styles in the wrong order #13265

@lsdsjy

Description

@lsdsjy

Describe the bug

The styling behavior of the legacy bundle differs from that of the modern bundle. Can be reproduced when common chunks are generated.

I've provided a stackblitz environment with pre-built dist, and modified the index.html to ensure the legacy bundle executed. The buttons should be green and blue respectively(as on dev and modern bundle), but they are all black on legacy bundle.

Reproduction

https://stackblitz.com/edit/vite-ubkstt?file=dist%2Findex.html,dist%2Fassets%2FGreenButton-legacy-a72b2200.js

Steps to reproduce

No response

System Info

npmPackages:
    @vitejs/plugin-legacy: ^4.0.3 => 4.0.3
    vite: ^4.3.8 => 4.3.8

Used Package Manager

yarn

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions