Repository navigation
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 |
|
@KingHenne man, you're fast! :-D |
|
Ok, merged and released |
Hey, I have two fixes here. :-)