From 3bb0fec73a2fab47953b51d256f0f5378f236ad1 Mon Sep 17 00:00:00 2001 From: Joe Clay <27cupsofcoffee@gmail.com> Date: Thu, 6 Oct 2016 17:26:51 +0100 Subject: [PATCH] Use a relative path for the declaration assets (#214) This will resolve the declaration issue. --- index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index e6f6109e8..f688196c7 100644 --- a/index.ts +++ b/index.ts @@ -496,7 +496,8 @@ function ensureTypeScriptInstance(loaderOptions: LoaderOptions, loader: any): { let output = languageService.getEmitOutput(filePath); let declarationFile = output.outputFiles.filter(filePath => !!filePath.name.match(/\.d.ts$/)).pop(); if (declarationFile) { - compilation.assets[declarationFile.name] = { + let assetPath = path.relative(process.cwd(), declarationFile.name); + compilation.assets[assetPath] = { source: () => declarationFile.text, size: () => declarationFile.text.length };