csstools / csstools/postcss-normalize
ForceImport works wrong
- Dominant language
- CSS
- Stars
- 837
- Forks
- 40
- PR merge metrics
- No merged PRs in 30d
Description
### How To Reproduce:
1) create a basic project with webpack 4 and postcss
2) for postcss-normalize set ```forceImport: true``` option
3) in entry file add several imports "[someName].css"
4) build project
https://github.com/Yegorich555/FromScratch_React/tree/postcss-forceImport-bug - for this link use npm run build-dev;
5) look into main.css file
### Actual behavior
We have postcssNormalize result as many as we have css imports in main.js
https://www.screencast.com/t/uBP6hZegP
### Expected behavior
```forceImport``` should inject normalize-result once independently on the number of css imports into main.js. Also, this reason why it also doesn't work with *.vue files since ones have several css import (scoped and global)
Contributor guide
Research direction
Reproduce the issue with the linked project by running npm run build-dev, then inspect main.css after adding several CSS imports in the entry file. Trace how forceImport is applied in the webpack/PostCSS setup; done means the normalize result is injected only once, including when multiple scoped and global CSS imports come from a Vue file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, webpack
- Domain
- build-system, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100