File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -10,14 +10,10 @@ module.exports = function(source, map) {
10
10
// Pass on query parameters as an options object to the DtsCreator. This lets
11
11
// you change the default options of the DtsCreator and e.g. use a different
12
12
// output folder.
13
- var queryOptions = loaderUtils . getOptions ( this ) ;
14
- var options ;
15
- var emitFile = true ;
16
- if ( queryOptions ) {
17
- options = Object . assign ( { context : process . cwd ( ) } , queryOptions ) ;
18
- emitFile = ! options . noEmit ;
19
- delete options . noEmit ;
20
- }
13
+ var options = loaderUtils . getOptions ( this ) || { } ;
14
+ var context = options . context || this . context || this . rootContext ;
15
+ var emitFile = ! options . noEmit ;
16
+ delete options . noEmit ;
21
17
22
18
var creator = new DtsCreator ( options ) ;
23
19
@@ -26,7 +22,7 @@ module.exports = function(source, map) {
26
22
creator . create ( this . resourcePath , source ) . then ( content => {
27
23
if ( emitFile ) {
28
24
// Emit the created content as well
29
- this . emitFile ( path . relative ( options . context , content . outputFilePath ) , content . contents || [ '' ] , map ) ;
25
+ this . emitFile ( path . relative ( context , content . outputFilePath ) , content . contents || [ '' ] , map ) ;
30
26
}
31
27
content . writeFile ( ) . then ( _ => {
32
28
callback ( null , source , map ) ;
You can’t perform that action at this time.
0 commit comments