From ac66d437378f8a0bed025058bd1a489ca3ed9ff6 Mon Sep 17 00:00:00 2001 From: Joseph Clay <27cupsofcoffee@gmail.com> Date: Fri, 27 May 2016 12:57:06 +0100 Subject: [PATCH] Use a relative path for the declaration assets --- index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index 04b6881d4..8e1847def 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 };