-
-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Description
Hi @ai, thank you for your work on postcss
and autoprefixer
(and your other packages). We're using them in combination with Vite, Svelte, and Tailwind, and we'd appreciate a clarification on how to specify plugins in postcss.config.cjs
.
In this repo (ref), you instruct to require and then invoke a plugin:
module.exports = ({ env }) => ({
plugins: [
env === 'production' ? require('postcss-plugin')() : false // <- with invocation
]
})
In autoprefixer (ref), you instruct to require a plugin without invoking it:
module.exports = {
plugins: [
require('autoprefixer') // <- without invocation
]
}
While investigating performance issues with VS Code, I added a console.log
to tailwind.config.cjs
and found that:
- With
require('tailwindcss')
, Tailwind's config file is loaded several times - With
require('tailwindcss')()
, Tailwind's config file is loaded only once
Question: Could you clarify what is the preferred way to specify plugins?
Thank you for your help!
Metadata
Metadata
Assignees
Labels
No labels