Comments (8)
I'm afraid that's not possible with the postcss-plugin-only approach because in this case the build tool decides when each file is processed and I cannot say "process only the final output".
The only thing you could do here is starting two build processes where the 2nd one would process the file, emitted by the 1st one. However doesn't seem to be a good solution.
Therefore I think you should definitely go with the webpack plugin because this has much more power since it's more than just a postcss plugin. I'm not sure how well this works with CSS modules though.
I'd suggest you open a new issue in media-query-plugin repository and provide a reproducible example build process (e.g. using https://codesandbox.io/) and then describe what you would expect so that I can take a look at what can be done.
from postcss-extract-media-query.
@alpipego thanks for using this plugin and your question.
I'm not sure if I understood you correctly.
Would you provide more details regarding your project setup?
Is the component specific CSS defined in separate files?
If so I'd suggest to work over your build process to limit this PostCSS plugin to your main file only.
from postcss-extract-media-query.
Thanks for your reply. This was a typical case of looking at the trees without seeing the woods. Instead of globbing all files in a dir, I now have a separate (grunt) PostCSS task that only runs on the main file (as you suggested).
Thanks for making this plugin. It's exactly what I was looking for 💯🔥
from postcss-extract-media-query.
Hey, i wanna do something similar.
@alpipego @SassNinja could you explain more here pls.
from postcss-extract-media-query.
Hi @ajayjaggi97
what do you mean with "similar"?
In this issue it was about not processing all files which in the end was achieved by adjusting the build process. So it depends on what build tool you're using or rather how your setup looks.
from postcss-extract-media-query.
I am using webpack and postcss-loader
I want to extract the media queries from the final output file(build file) rather than the individual files.
from postcss-extract-media-query.
-
are you aware there's a specialised webpack plugin?
https://github.com/SassNinja/media-query-plugin -
why do you wanna extract from the final output instead of the individual files? The result should be the same.
from postcss-extract-media-query.
Yes i checked the webpack plugin as well.
But the in extracted files, classnames are not getting dangled.(css modules)
So i thought extracting from the final output file might resolve the issue.
from postcss-extract-media-query.
Related Issues (20)
- extractAll not working HOT 3
- @supports queries in @media queries get removed HOT 6
- Possibility to leave original file intact? HOT 2
- Keep the media in same file HOT 2
- extractAll query mismatch HOT 1
- media css files generated but default.css missing HOT 1
- README file suggests this approach has a bigger performance impact than it actually does HOT 2
- Duplicated a media rules in css HOT 7
- cssnano and sourcemaps HOT 5
- Rules get applied every time a new file is processed HOT 3
- Unknown error, different PostCSS versions HOT 1
- Is it possible to use several entries? HOT 2
- Proposal: attach processing to OnceExit hook
- Plugin + Foundation setup HOT 13
- Webpack & entrypoints.json HOT 2
- Sass files in dist folder (Using Vite example) HOT 1
- Invalid PostCSS Plugin found HOT 3
- Can this be used to only combine media queries? HOT 1
- File naming gets confused if source file names have more than one dot in them HOT 1
- Multiple media queries into one file. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postcss-extract-media-query.