Skip to content

Looks like plugin overwrites some files without errors/warnings #804

@krutoo

Description

@krutoo
  • Operating System: Ubuntu
  • Node Version: 14.16.0
  • NPM Version: 7.20.0
  • webpack Version: 5.48.0
  • mini-css-extract-plugin Version: 2.2.0

Expected Behavior

Accorging to docs:
https://webpack.js.org/plugins/mini-css-extract-plugin/#extracting-css-based-on-entry

I have two entry points in webpack config (desktop and mobile) with optimization like in article.

In each JS entry i have css imports (css-modules)

I expect to get something in dist folder similar to:

dist
├── mobile
│   ├── index.js
│   └── index.css
└── desktop
    ├── index.js  
    └── index.css

Actual Behavior

In my dist folder after build i have:

dist
├── mobile
│   └── index.js
├── desktop
│   └── index.js  
└── mobile_styles
    └── index.css

There is also no "styles_desktop" folder or something similar with desktop styles.

How Do We Reproduce?

Repo with example project here:
https://github.com/krutoo/mini-css-extract-plugin-tests

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