Skip to content

Commit

Permalink
Windows fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
laura-rubio committed Apr 27, 2023
1 parent 6cd427d commit 0b00af4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/sass.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { merge, normalizePath, replaceExtension } from "../core/utils.ts";
import Sass from "../deps/sass.ts";
import { posix, toFileUrl } from "../deps/path.ts";
import { posix, toFileUrl, fromFileUrl } from "../deps/path.ts";
import { Page } from "../core/filesystem.ts";
import { prepareAsset, saveAsset } from "./source_maps.ts";
import textLoader from "../core/loaders/text.ts";
Expand Down Expand Up @@ -57,7 +57,7 @@ export default function (userOptions?: Partial<Options>) {
url: toFileUrl(filename),
importer: {
canonicalize(url: string) {
let pathname = new URL(url).pathname;
let pathname = normalizePath(fromFileUrl(url));

if (pathname.startsWith(basePath)) {
pathname = normalizePath(pathname.slice(basePath.length));
Expand All @@ -79,10 +79,10 @@ export default function (userOptions?: Partial<Options>) {
}
}

throw new Error(`File not be canonicalized: ${url} (${pathname})`);
throw new Error(`File cannot be canonicalized: ${url} (${pathname})`);
},
async load(url: URL) {
let pathname = url.pathname;
let pathname = normalizePath(fromFileUrl(url));

if (pathname.startsWith(basePath)) {
pathname = normalizePath(pathname.slice(basePath.length));
Expand Down

0 comments on commit 0b00af4

Please sign in to comment.