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

fix: LoaderContext type #18157

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

SyMind
Copy link

@SyMind SyMind commented Mar 5, 2024

What kind of change does this PR introduce?

Type wrong.

Did you add tests for your changes?

The resourcePath, resourceQuery, and resourceFragment properties within LoaderRunnerLoaderContext may not be defined if a loader is invoked without an associated resource.

For evidence of this behavior, refer to the test case located in test/cases/loaders/query/index.js. The test titled "should pass query to loader without resource" confirms this scenario.

However, this behavior could lead to type errors for loaders written in TypeScript. To address this, the loader-runner can be updated to assign an empty string as a default value for these properties.

Which plan do you think is better?

Does this PR introduce a breaking change?

What needs to be documented once your changes are merged?

Copy link

linux-foundation-easycla bot commented Mar 5, 2024

CLA Signed


The committers listed above are authorized under a signed CLA.

@webpack-bot
Copy link
Contributor

For maintainers only:

  • This needs to be documented (issue in webpack/webpack.js.org will be filed when merged)
  • This needs to be backported to webpack 4 (issue will be created when merged)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: On Hold
Development

Successfully merging this pull request may close these issues.

None yet

2 participants