From ad86c3b064a3f90a918524fa9f172d78d3f1c508 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Wed, 21 Oct 2020 00:26:46 +1300 Subject: [PATCH] Fix all relative paths in built output --- build.js | 4 ++-- src/sass/base.sass | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.js b/build.js index dc1c6da..4932101 100644 --- a/build.js +++ b/build.js @@ -154,11 +154,11 @@ async function addSass(sourcePath, targetPath) { indentType: "tab", indentWidth: 1, functions: { - "static($name)": function(name) { + "relative($name)": function(name) { if (!(name instanceof sass.types.String)) { throw "$name: expected a string" } - const result = static.get(name.getValue()) + const result = getRelative(targetPath, static.get(name.getValue())) if (typeof result === "string") { return new sass.types.String(result) } else { diff --git a/src/sass/base.sass b/src/sass/base.sass index 2feecde..0232c2e 100644 --- a/src/sass/base.sass +++ b/src/sass/base.sass @@ -2,7 +2,7 @@ @font-face font-family: Whitney font-weight: $weight - src: url(static("/assets/fonts/whitney-" + $weight + ".woff")) format("woff2") + src: url(relative("/assets/fonts/whitney-" + $weight + ".woff")) format("woff2") +import-whitney(400) +import-whitney(500)