From 7d9388ee422fa573d498704b1cb0705dbcead7db Mon Sep 17 00:00:00 2001 From: choyweston Date: Sun, 13 Nov 2016 21:20:34 -0500 Subject: [PATCH] Keep Hashes in URL when rewriting relative URLs For certain use cases, like SVG filters, the url needs to have a # symbol. For example, the following css property : ```filter:url("filters.svg#lightGreen")``` In the current version of the codebase, gets rewritten to : ```filter:url("http://myapp.com/filters.svg")``` Whereas the proper behaviour should be: ```filter:url("http://myapp.com/filters.svg#lightGreen")``` This simple change will fix the issue. --- packages/minifier-css/minifier.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/minifier-css/minifier.js b/packages/minifier-css/minifier.js index 0994ee6fc8..5489823b5e 100644 --- a/packages/minifier-css/minifier.js +++ b/packages/minifier-css/minifier.js @@ -145,7 +145,7 @@ var rewriteRules = function (rules, mergedCssPath) { // Rewrite relative paths (that refers to the internal application tree) // to absolute paths (addressable from the public build). if (isRelative(resource.path)) { - absolutePath = pathJoin(basePath, resource.path); + absolutePath = pathJoin(basePath, resource.path + resource.hash); } else { absolutePath = resource.path; }