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

Use resource path when adding dependency. #26

Merged
merged 1 commit into from
Feb 13, 2021

Conversation

vseventer
Copy link
Contributor

This Pull Request:

  • Passes the absolute path to addDependency, rather than the provided remaining request.

Why is this PR needed?

The request variable is in the inline loader format, and contains the remaining loaders. For example, if you're using babel-loader on your script files, then request = "/path/to/project/node_modules/babel-loader/lib/index.js!/path/to/project/scripts/main.js".

This breaks watch mode, as addDependency expects the absolute path to the dependency itself, not including any loaders. Therefore, this PR uses this.resourcePath.

Things to Note

I think this might be a Webpack 5 only issue (this loader was working fine in Webpack 4 for me).

@erikdesjardins
Copy link
Owner

Thanks! I'll release this momentarily

@erikdesjardins erikdesjardins merged commit bd2aaa8 into erikdesjardins:master Feb 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants