From 7c4aee07c273064605d454523d3a439b9aa67657 Mon Sep 17 00:00:00 2001 From: Andrew Taylor Date: Thu, 5 Apr 2018 23:03:56 +0000 Subject: [PATCH 1/2] When a deployUrl consists of an absolute path, it needs to be prepended to the outputUrl since url.resolve will just ignore it --- packages/@angular/cli/plugins/postcss-cli-resources.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/@angular/cli/plugins/postcss-cli-resources.ts b/packages/@angular/cli/plugins/postcss-cli-resources.ts index 7cd00695048d..bb524dae26dd 100644 --- a/packages/@angular/cli/plugins/postcss-cli-resources.ts +++ b/packages/@angular/cli/plugins/postcss-cli-resources.ts @@ -95,7 +95,11 @@ export default postcss.plugin('postcss-cli-resources', (options: PostcssCliResou } if (deployUrl) { - outputUrl = url.resolve(deployUrl, outputUrl); + if (deployUrl.startsWith('/')) { + outputUrl = deployUrl + outputUrl; + } else { + outputUrl = url.resolve(deployUrl, outputUrl); + } } resourceCache.set(inputUrl, outputUrl); From 188590fd6d5937a43567a583da8d4d5aa6fe1b72 Mon Sep 17 00:00:00 2001 From: Andrew Taylor Date: Thu, 5 Apr 2018 23:47:16 +0000 Subject: [PATCH 2/2] The outputPath is relative so we need to add a slash between it and the deployUrl. Remove any trailing slash from the deployUrl itself. --- packages/@angular/cli/plugins/postcss-cli-resources.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@angular/cli/plugins/postcss-cli-resources.ts b/packages/@angular/cli/plugins/postcss-cli-resources.ts index bb524dae26dd..c9ef5abb670c 100644 --- a/packages/@angular/cli/plugins/postcss-cli-resources.ts +++ b/packages/@angular/cli/plugins/postcss-cli-resources.ts @@ -96,7 +96,7 @@ export default postcss.plugin('postcss-cli-resources', (options: PostcssCliResou if (deployUrl) { if (deployUrl.startsWith('/')) { - outputUrl = deployUrl + outputUrl; + outputUrl = deployUrl.replace(/\/$/, '') + '/' + outputUrl; } else { outputUrl = url.resolve(deployUrl, outputUrl); }