importing creates hundreds of duplicates
See original GitHub issueI have a situation where I ‘have’ to import a file in EVERY single css file in my entire app. This is because you get thousands of errors if you try to use css variables and haven’t imported the file that defines the variables in that specific css file in question.
@import "styles/theme";
The problem is that every single time I do that it creates another :root
. Chrome doesn’t seem to slow down much but safari is taking about 10-15 mintues just to load a list of available styles because it appears to be bogged down by this? There are some situations that I get to hundreds of :root with all the same variables declared over and over and over.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:7
Top Results From Across the Web
Resolve duplicates while importing contacts into Contacts on ...
Resolve duplicates while importing contacts into Contacts on Mac · Resolve all duplicates the same way: Select Apply to All, then click Import....
Read more >Import folder functionality periodically freaks out, importing ...
I drop .pdf files into the designated folder and they are imported as notes. Very handy, until Evernote freaks out and starts creating...
Read more >Why is CSV bulk import creating duplicates?
Import then creates hundreds of issues, with many duplicate copies of each row. I don't know how long it would continue, the first...
Read more >Handling Duplicated Event Imports - Knowledgebase
Running an import and seeing existing events duplicated on your site can be extremely frustrating. This article should help you determine ...
Read more >Duplicates importing during network import of PST files into ...
The doucs sate: "How does the PST import process handle duplicate email items? The PST import process checks for duplicate ... Created on...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Closing for lack of action.
Pass the variables to the plugin instead 😃 https://github.com/postcss/postcss-custom-properties#variables (used by cssnext)
In general && if avoidable I recommend to not use
@import
at all in conjunction with webpack, bc this can bloat your CSS significantly in some cases. E.g for frameworks like bootstrap it is better to add an additional<link>
. Most of the time keeping the CSS strictly scoped to the component is the less painful solution, it’s a shift in mind compared to the ‘traditional’ approach of writing CSS, but in the common way you will have a hard time getting it ‘right’ 😛.Finally if you really need to rely on
@import
usecss-loader
’simportLoaders
instead ofpostcss-import
, which will make a separate request webpack can dedupe to some point@import 'path/to/file.css'
=>importLoaders
=>require('css-loader!postcss-loader!./path/to/file.css')