webpack / enhanced-resolve

Offers an async require.resolve function. It's highly configurable.
MIT License
916 stars 186 forks source link

[draft] feat: resolve style field in package json #388

Closed burhanuday closed 1 year ago

burhanuday commented 1 year ago

Part of https://github.com/webpack/webpack/issues/14893

supports style resolution in package.json and test it + test support loader usage

codecov[bot] commented 1 year ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (main@3c3d31e). Click here to learn what that means. Patch coverage: 94.87% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #388 +/- ## ======================================= Coverage ? 92.88% ======================================= Files ? 44 Lines ? 2081 Branches ? 615 ======================================= Hits ? 1933 Misses ? 120 Partials ? 28 ``` | [Impacted Files](https://app.codecov.io/gh/webpack/enhanced-resolve/pull/388?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=webpack) | Coverage Δ | | |---|---|---| | [lib/StyleFieldPlugin.js](https://app.codecov.io/gh/webpack/enhanced-resolve/pull/388?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=webpack#diff-bGliL1N0eWxlRmllbGRQbHVnaW4uanM=) | `94.28% <94.28%> (ø)` | | | [lib/ResolverFactory.js](https://app.codecov.io/gh/webpack/enhanced-resolve/pull/388?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=webpack#diff-bGliL1Jlc29sdmVyRmFjdG9yeS5qcw==) | `96.21% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

alexander-akait commented 1 year ago

@burhanuday It should not implemented here, we already support it in css-loader https://github.com/webpack-contrib/css-loader/blob/master/src/plugins/postcss-import-parser.js#L228, we just need to update defaults in webpack

burhanuday commented 1 year ago

Ah. Will update the defaults in webpack. Did not occur to me that we could just change the default options. Closing this PR