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.

Provide documentation link for the warning ` Using a JavaScript PostCSS config file means losing out on caching features of Parcel. Use a .postcssrc(.json) file whenever possible.`

See original GitHub issue

🙋 feature request

I’m using Tailwind and Parcel 2 and every time I build I get this warning: Using a JavaScript PostCSS config file means losing out on caching features of Parcel. Use a .postcssrc(.json) file whenever possible.

However, when I delete the config file Tailwind no longer works.

Please will you add more detail to this warning, or a link to some Parcel documentation explaining what we have to do here to make it work.

Even a comprehensive answer in this issue would probably help people like me who are googling this warning and finding nothing 😦

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:6
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

12reactions
mischniccommented, Jan 22, 2021

Instead of something postcss.config.js

module.exports = {
  plugins: {
    tailwindcss: {},
    autoprefixer: {},
  }
}

you should add a .postcssrc with:

{
  plugins: {
    tailwindcss: {},
    autoprefixer: {},
  }
}
0reactions
mischniccommented, Jul 6, 2021

Babel’s env property in config files is great for this:

{
	"presets": ["@babel/preset-env"],
	"env": {
		"development": {
			"plugins": ["babel-plugin-run-only-in-dev"]
		}
	}
}

Unfortunately PostCSS doesn’t have something like this (yet)

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I solve error : "@parcel/transformer-postcss
@parcel/transformer-postcss: PostCSS config must have plugins at load ... file means losing... Use a .postcssrc json file whenever possible).
Read more >
CSS - Parcel
You can use PostCSS with Parcel by creating a configuration file using one of these names: .postcssrc , .postcssrc.json , .postcssrc.js , or...
Read more >
Advanced Features: Customizing PostCSS Config - Next.js
Warning : When you define a custom PostCSS configuration file, Next.js completely disables the default behavior. Be sure to manually configure all the ......
Read more >
Adam Wathan on Twitter: "I can't seem to get `postcss.config.js ...
config.js` files working in ESM Next projects If I use `postcss.config.cjs` the file is ignored, but if ...
Read more >
@parcel/transformer-postcss NPM | npm.io
Out of the box support for JS, CSS, HTML, file assets, and more - no plugins to install. Automatically transforms modules using Babel,...
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