diff --git a/packages/compiler-cli/src/extractor.ts b/packages/compiler-cli/src/extractor.ts index aaf4a4f0779fc..99a6e8f9f7447 100644 --- a/packages/compiler-cli/src/extractor.ts +++ b/packages/compiler-cli/src/extractor.ts @@ -67,8 +67,9 @@ export class Extractor { serializer = new compiler.Xliff(); } return bundle.write( - serializer, - (sourcePath: string) => sourcePath.replace(path.join(this.options.basePath, '/'), '')); + serializer, (sourcePath: string) => this.options.basePath ? + path.relative(this.options.basePath, sourcePath) : + sourcePath); } getExtension(formatName: string): string {