Skip to content

Commit 94f9724

Browse files
author
Emanuel Kluge
committed
fix: use correct options object & set fallback context
1 parent ce2cf1d commit 94f9724

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = function(source, map) {
1414
var options;
1515
var emitFile = true;
1616
if (queryOptions) {
17-
options = Object.assign({}, queryOptions);
17+
options = Object.assign({ context: process.cwd() }, queryOptions);
1818
emitFile = !options.noEmit;
1919
delete options.noEmit;
2020
}
@@ -26,7 +26,7 @@ module.exports = function(source, map) {
2626
creator.create(this.resourcePath, source).then(content => {
2727
if (emitFile) {
2828
// Emit the created content as well
29-
this.emitFile(path.relative(this.options.context, content.outputFilePath), content.contents || [''], map);
29+
this.emitFile(path.relative(options.context, content.outputFilePath), content.contents || [''], map);
3030
}
3131
content.writeFile().then(_ => {
3232
callback(null, source, map);

0 commit comments

Comments
 (0)