question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to integrate PostCSS

See original GitHub issue

Hello, 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:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
natemoo-recommented, Dec 21, 2020

I added a working Tailwind example in cadd0a5. Since Tailwind doesn’t currently support a tailwind.config.cjs file (I’m planning to make a PR to fix this), you need to actually require the config from postcss.config.cjs and then pass it to the tailwindcss plugin. Not ideal, but it works for now. Once Tailwind supports a .cjs config file this should be much easier.

4reactions
natemoo-recommented, Dec 20, 2020

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’s package.json file. PostCSS only picks up on CJS, so try postcss.config.cjs?

Microsite automatically uses the official Snowpack plugin if it picks up on a PostCSS configuration file (via cosmiconfig). Custom snowpack.config.js files is something I want to add for the next release, though.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found