-
Notifications
You must be signed in to change notification settings - Fork 23
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: use correct options object & set fallback context #20
fix: use correct options object & set fallback context #20
Conversation
Could you please describe what it fixes |
When using the loader with
My guess was, that this is related to treating the options as an instance variable, while it's actually a local variable. After fixing that, I got the following error:
This is because An alternative approach would be to fall back to an empty string: - this.emitFile(path.relative(options.context, content.outputFilePath), content.contents || [''], map);
+ this.emitFile(path.relative(options.context || '', content.outputFilePath), content.contents || [''], map); What do you think? |
Did you try to use |
No, since it's not a required option parameter. |
I'm also interested in this fix. In my opinion the proposed solution makes sense. Setting the - this.emitFile(path.relative(this.options.context, content.outputFilePath), content.contents || [''], map);
+ this.emitFile(path.relative(options.context, content.outputFilePath), content.contents || [''], map); |
Looking at other PRs (like this one or this one), I think this is the correct fix: - this.emitFile(path.relative(this.options.context, content.outputFilePath), content.contents || [''], map);
+ var context = options.context || this.context || this.rootContext;
+ this.emitFile(path.relative(context, content.outputFilePath), content.contents || [''], map); And also initialising |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
@KingHenne man, you're fast! :-D |
Ok, merged and released |
Hey, I have two fixes here. :-)