Repository: create-react-app
Issue: loader `this.resourcePath` only match node_modules path
Labels: needs triage,issue: bug report

<!--
    Please note that your issue will be fixed much faster if you spend about
    half an hour preparing it, including the exact reproduction steps and a demo.

    If you're in a hurry or don't feel confident, it's fine to report bugs with
    less details, but this makes it less likely they'll get fixed soon.

    In either case, please use this template and fill in as many fields below as you can.

    Note that we don't provide help for webpack questions after ejecting.
    You can find webpack docs at https://webpack.js.org/.
-->

### Describe the bug

I run `npm run eject`, I build a my loader, I console.log source path, but it only console path of node_modules, why?
```js
// pulgin.js
exports.default = function (code) {
  console.log(this.resourcePath)
  return code
}
```
```js
           {
              test: /\.js$/,
              enforce: 'pre',
              loader: require.resolve('./pulgin.js')
            },
```
when I run `npm run build` console
```js
D:\work\react-test\node_modules\react-dom\client.js
D:\work\react-test\node_modules\react\index.js
D:\work\react-test\node_modules\react\jsx-runtime.js
D:\work\react-test\node_modules\css-loader\dist\runtime\sourceMaps.js
D:\work\react-test\node_modules\css-loader\dist\runtime\api.js
D:\work\react-test\node_modules\react\cjs\react-jsx-runtime.production.min.js
D:\work\react-test\node_modules\react\cjs\react.production.min.js
D:\work\react-test\node_modules\react-dom\index.js
D:\work\react-test\node_modules\web-vitals\dist\web-vitals.js
D:\work\react-test\node_modules\react-dom\cjs\react-dom.production.min.js
D:\work\react-test\node_modules\scheduler\index.js
D:\work\react-test\node_modules\scheduler\cjs\scheduler.production.min.js
Compiled successfully.
```
### Did you try recovering your dependencies?

"webpack": "^5.88.1",

### Which terms did you search for in User Guide?

<!--
  There are a few common documented problems, such as watcher not detecting changes, or build failing.
  They are described in the Troubleshooting section of the User Guide:

  https://facebook.github.io/create-react-app/docs/troubleshooting

  Please scan these few sections for common problems.
  Additionally, you can search the User Guide itself for something you're having issues with:

  https://facebook.github.io/create-react-app/

  If you didn't find the solution, please share which words you searched for.
  This helps us improve documentation for future readers who might encounter the same problem.
-->

(Write your answer here if relevant.)

### Environment

<!--
  To help identify if a problem is specific to a platform, browser, or module version, information about your environment is required.
  This enables the maintainers quickly reproduce the issue and give feedback.

  Run the following command in your React app's folder in terminal.
  Note: The result is copied to your clipboard directly.

  `npx create-react-app --info`

  Paste the output of the command in the section below.
-->

  current version of create-react-app: 5.0.1
  running from D:\npm_cache\_npx\c67e74de0542c87c\node_modules\create-react-app

  System:
    OS: Windows 10 10.0.22621
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H
  Binaries:
    Node: 18.16.1 - D:\nodejs\node.EXE
    Yarn: 1.22.19 - D:\npm_global\node_modules\yarn\bin\yarn.CMD
    npm: 9.7.2 - D:\nodejs\npm.CMD
  Browsers:
    Chrome: Not Found
    Edge: Spartan (44.22621.1992.0), Chromium (114.0.1823.82)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    react: ^18.2.0 => 18.2.0
    react-dom: ^18.2.0 => 18.2.0
    react-scripts: Not Found
  npmGlobalPackages:
    create-react-app: Not Found

### Steps to reproduce

<!--
  How would you describe your issue to someone who doesn’t know you or your project?
  Try to write a sequence of steps that anybody can repeat to see the issue.
-->

(Write your steps here:)

1. npm run eject

### Expected behavior

<!--
  How did you expect the tool to behave?
  It’s fine if you’re not sure your understanding is correct.
  Just write down what you thought would happen.
-->

I expected can conole src path file, eg: 
```js
D:\work\react-test\src\index.js
...
Compiled successfully.
```

### Actual behavior

<!--
  Did something go wrong?
  Is something broken, or not behaving as you expected?
  Please attach screenshots if possible! They are extremely helpful for diagnosing issues.
-->
Actual behavior
```js
D:\work\react-test\node_modules\react-dom\client.js
D:\work\react-test\node_modules\react\index.js
D:\work\react-test\node_modules\react\jsx-runtime.js
D:\work\react-test\node_modules\css-loader\dist\runtime\sourceMaps.js
D:\work\react-test\node_modules\css-loader\dist\runtime\api.js
D:\work\react-test\node_modules\react\cjs\react-jsx-runtime.production.min.js
D:\work\react-test\node_modules\react\cjs\react.production.min.js
D:\work\react-test\node_modules\react-dom\index.js
D:\work\react-test\node_modules\web-vitals\dist\web-vitals.js
D:\work\react-test\node_modules\react-dom\cjs\react-dom.production.min.js
D:\work\react-test\node_modules\scheduler\index.js
D:\work\react-test\node_modules\scheduler\cjs\scheduler.production.min.js
Compiled successfully.
```

### Reproducible demo

<!--
  If you can, please share a project that reproduces the issue.
  This is the single most effective way to get an issue fixed soon.

  There are two ways to do it:

    * Create a new app and try to reproduce the issue in it.
      This is useful if you roughly know where the problem is, or can’t share the real code.

    * Or, copy your app and remove things until you’re left with the minimal reproducible demo.
      This is useful for finding the root cause. You may then optionally create a new project.

  This is a good guide to creating bug demos: https://stackoverflow.com/help/mcve
  Once you’re done, push the project to GitHub and paste the link to it below:
-->

https://github.com/mmdctjj/react-test/tree/feat-test

<!--
  What happens if you skip this step?

  We will try to help you, but in many cases it is impossible because crucial
  information is missing. In that case we'll tag an issue as having a low priority,
  and eventually close it if there is no clear direction.

  We still appreciate the report though, as eventually somebody else might
  create a reproducible example for it.

  Thanks for helping us help you!
-->