`require('postcss-plugin')()` vs `require('postcss-plugin')` (without invocation)
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Documentation
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- javascript, tailwindcss
- Domaine
- documentation
Piste de recherche
Start by reading the plugin examples linked from postcss-load-config and autoprefixer, then compare them with the postcss.config.cjs and tailwind.config.cjs usage described here. Clarify the preferred invocation form and document the observable loading behavior so the examples agree.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
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!
- Langage dominant
- JavaScript
- Étoiles
- 661
- Forks
- 76
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de postcss/postcss-load-config
-
Difficulté 3/5 1-2 jours Accessibilité débutants 25/100
postcss/postcss-load-config#266 · 3 commentaires ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
postcss/postcss-load-config#248 · 1 commentaire ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 38/100
postcss/postcss-load-config#221 · 4 commentaires ·
-
How to use async function?Ouverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
postcss/postcss-load-config#212 · 7 commentaires ·
-
Load config from NPM packageOuvertepriority: medium semver: minor type: feature
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
postcss/postcss-load-config#183 · 1 commentaire · 4 réactions ·
Toutes les issues de postcss/postcss-load-config
Issues similaires
-
fix: the live capture mode of check-native-browser.mjs ignores PLAYWRIGHT_CHROMIUM_EXECUTABLEOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
Forrest-Technologies/drover#1040 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
Les mainteneurs répondent en général sous 1 jour
-
good first issue help wanted
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
erkamyaman/rust-anything#702 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
-
good first issue help wanted
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
erkamyaman/unslop-anything#231 ·
Les mainteneurs répondent en général sous 1 jour