43081j / 43081j/postcss-lit

Verify Webpack Documentation

Offen Anfängerfreundlich
#34 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
90
Forks
9
Ø Merge
1 T. 9 Min.
Gemergte PRs (30 T.)
3

Beschreibung

The documentation for Webpack didn't work for me

https://github.com/43081j/postcss-lit/blob/48c6f363faad026f151065fb61569f4db1fde688/README.md?plain=1#L33-L60

When I switched it around it started working as expected. Here's our order:

```
{
test: /\.ts$/,
use: [
'babel-loader',
'ts-loader',
'postcss-loader',
],
exclude: /node_modules/
}
```

We're on Webpack version 5 in a monorepo, though I don't think that matters much.

After further investigation, as your readme states "_postcss will transform your CSS before typescript transpiles_", Webpack loaders are executed in reverse order (see [Webpack's documentation](https://webpack.js.org/concepts/loaders/#configuration)). So we'd want `postcss-loader` last in the array so it can be first. I still don't understand why Webpack works this way, I'm sure there's a lengthy thread somewhere but it's illogical to me.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

The issue points to a specific section of the README (lines 33-60) that describes Webpack configuration. The user found that the documented loader order is reversed relative to Webpack's execution order. To verify, read the linked Webpack documentation on loader execution, then check the README.md file around the mentioned lines. The fix is to update the example array so 'postcss-loader' appears last, ensuring it runs first. A test would involve setting up a minimal Webpack project with the corrected configuration to confirm CSS extraction works.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript, webpack
Bereich
documentation, tooling
Issue-Typ
Dokumentation
Schwierigkeit
1/5
Geschätzter Aufwand
Unter einer Stunde
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
75/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.