`require('postcss-plugin')()` vs `require('postcss-plugin')` (without invocation)
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Dokumentation
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- javascript, tailwindcss
- Bereich
- documentation
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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!
- Vorherrschende Sprache
- JavaScript
- Sterne
- 661
- Forks
- 76
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus postcss/postcss-load-config
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 25/100
postcss/postcss-load-config#266 · 3 Kommentare ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
postcss/postcss-load-config#248 · 1 Kommentar ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 38/100
postcss/postcss-load-config#221 · 4 Kommentare ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
postcss/postcss-load-config#212 · 7 Kommentare ·
-
priority: medium semver: minor type: feature
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
postcss/postcss-load-config#183 · 1 Kommentar · 4 Reaktionen ·
Alle Issues in postcss/postcss-load-config
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
Forrest-Technologies/drover#1040 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag
-
good first issue help wanted
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
erkamyaman/rust-anything#702 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
-
good first issue help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
erkamyaman/unslop-anything#231 ·
Maintainer antworten meist innerhalb von 1 Tag