Skip to content

Commit 3bb0fec

Browse files
17cupsofcoffeejohnnyreilly
authored andcommitted
Use a relative path for the declaration assets (#214)
This will resolve the declaration issue.
1 parent b71cadb commit 3bb0fec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,8 @@ function ensureTypeScriptInstance(loaderOptions: LoaderOptions, loader: any): {
496496
let output = languageService.getEmitOutput(filePath);
497497
let declarationFile = output.outputFiles.filter(filePath => !!filePath.name.match(/\.d.ts$/)).pop();
498498
if (declarationFile) {
499-
compilation.assets[declarationFile.name] = {
499+
let assetPath = path.relative(process.cwd(), declarationFile.name);
500+
compilation.assets[assetPath] = {
500501
source: () => declarationFile.text,
501502
size: () => declarationFile.text.length
502503
};

0 commit comments

Comments
 (0)