Skip to content

Warn about Webpack 5 requirement #515

@lostfictions

Description

@lostfictions

Documentation Is:

  • Missing
  • Needed
  • Confusing
  • Not Sure?

Please Explain in Detail...

I generally check changelogs when I'm upgrading dependencies, but a few days ago I tried adding postcss-loader to a greenfield project and couldn't figure out why it wasn't working. I eventually gave up, but today I decided to dig into stacktraces and actually track down what was going on, and after much confusion finally discovered that webpack@4 support was dropped.

Unfortunately, lots of tooling is still stuck on webpack@4. For example, I'm using electron-forge. Most frameworks seem to be approaching the transition carefully -- for example, Next.js announced Webpack 5 support as a backwards-compatible beta but as of now don't appear to have flipped the switch to 5 by default.

Your Proposal for Changes

If you can't keep postcss-loader backwards-compatible, I'd propose to at least make a note in the readme about this change to save other folks some headscratching. It would also be nice to test whether getOptions is defined on this and give a more descriptive error message if so, to prevent more folks suffering from #514. (Happy to make a PR for this.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions