Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 2 commits into from

Conversation

burhanuday
Copy link
Member

Part of webpack/webpack#14893

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

Comment on lines +519 to +521
"existing-directory",
styleField,
"resolve-in-existing-directory"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: check if these are the correct source and target

return callback();
}
if (
// this.options.forceRelative
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: add support for forceRelative

// @ts-ignore
request.context.issuer &&
// @ts-ignore
request.context.issuer.endsWith(".css");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: check for all known css extensions
todo2: allow consumer to configure extensions array

const isIssuerAStyleFile =
request.context &&
// @ts-ignore
request.context.issuer &&
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: check if type can be improved

@codecov
Copy link

codecov bot commented Jun 6, 2023

Codecov Report

❗ 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
@@           Coverage Diff           @@
##             main     #388   +/-   ##
=======================================
  Coverage        ?   92.88%           
=======================================
  Files           ?       44           
  Lines           ?     2081           
  Branches        ?      615           
=======================================
  Hits            ?     1933           
  Misses          ?      120           
  Partials        ?       28           
Impacted Files Coverage Δ
lib/StyleFieldPlugin.js 94.28% <94.28%> (ø)
lib/ResolverFactory.js 96.21% <100.00%> (ø)

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

@alexander-akait
Copy link
Member

@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
Copy link
Member Author

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

@burhanuday burhanuday closed this Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants