webpack-contrib / postcss-loader

PostCSS loader for webpack
MIT License
2.86k stars 211 forks source link

fix(loadConfig): added fix when loading postcss esm configs #684

Closed lideen closed 6 months ago

lideen commented 6 months ago

This PR contains a:

Motivation / Use-Case

I'm using a ESM version of postcss config in one of my projects (postcss.config.mjs) and noticed that postcss-loader did not pick up the configuration. This fixes that issue.

Additional Info

One of the tests I added need to be run with NODE_OPTIONS=--experimental-vm-modules to enable ESM support in jest. Flip the test to it.only and run:

NODE_OPTIONS=--experimental-vm-modules npm run test:only -t 'config-autoload'
linux-foundation-easycla[bot] commented 6 months ago

CLA Signed


The committers listed above are authorized under a signed CLA.

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 88.30%. Comparing base (107b519) to head (53a2759). Report is 1 commits behind head on master.

Files Patch % Lines
src/utils.js 50.00% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #684 +/- ## ========================================== - Coverage 88.73% 88.30% -0.44% ========================================== Files 3 3 Lines 355 359 +4 Branches 116 118 +2 ========================================== + Hits 315 317 +2 - Misses 37 38 +1 - Partials 3 4 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.