How to integrate PostCSS
See original GitHub issueHello, I’m trying to enable PostCSS but the configuration file (postcss.config.js
) inside the project root is not recognized.
I’m also trying to integrate PostCSS by using the official snowpack plugin, but it doesn’t seem to work. I’ve created both snowpack.config.json
and postcss.config.js
.
EDIT: It seems that only .postcssrc
file is recognised.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
What is PostCSS? How to Use Plugins to Automate CSS Tasks
PostCSS is a Node.js tool that transforms your styles using JavaScript plugins. It generates more downloads per week on NPM than other CSS ......
Read more >Install Tailwind CSS using PostCSS
Installing Tailwind CSS as a PostCSS plugin is the most seamless way to integrate it with build tools like webpack, Rollup, Vite, and...
Read more >An Introduction to PostCSS - SitePoint
Write your own PostCSS plugins. A wide range of plugins is available for extending syntax, parsing future properties, adding fallbacks, ...
Read more >Getting started with PostCSS - LogRocket Blog
Quick PostCSS setup using Codepen ... Start by signing in to Codepen.io, and perform the following steps: ... 3. Select CSS from the...
Read more >How to integrate postcss and webpack - DEV Community
PostCSS plugins · postcss-import is used to replace @import with actual code. · autoprefixer is used to parse CSS and add vendor prefixes...
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
I added a working Tailwind example in
cadd0a5
. Since Tailwind doesn’t currently support atailwind.config.cjs
file (I’m planning to make a PR to fix this), you need to actually require the config frompostcss.config.cjs
and then pass it to thetailwindcss
plugin. Not ideal, but it works for now. Once Tailwind supports a.cjs
config file this should be much easier.I definitely want this to be super simple out of the box! In this case I think it might be because Microsite uses
"type": "module"
in a project’spackage.json
file. PostCSS only picks up on CJS, so trypostcss.config.cjs
?Microsite automatically uses the official Snowpack plugin if it picks up on a PostCSS configuration file (via
cosmiconfig
). Customsnowpack.config.js
files is something I want to add for the next release, though.