From 295aa6ed3a26c78308bde2fa1cc6e242875254e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Israel=20Ortiz=20Garc=C3=ADa?= Date: Wed, 7 Jun 2023 11:22:36 -0700 Subject: [PATCH 1/2] Legacy importer wrapper only searches for relative URLs if the URL is not canonicalized --- lib/src/legacy/importer.ts | 4 +++- tsconfig.json | 13 ++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/src/legacy/importer.ts b/lib/src/legacy/importer.ts index 0921c329..fc14d33b 100644 --- a/lib/src/legacy/importer.ts +++ b/lib/src/legacy/importer.ts @@ -125,7 +125,9 @@ export class LegacyImporterWrapper this.expectingRelativeLoad = false; return null; - } else { + } else if (!url.startsWith('file:')) { + // We'll only search for another relative import when the URL isn't + // canonicalized already. this.expectingRelativeLoad = true; } diff --git a/tsconfig.json b/tsconfig.json index 693fadcb..3b01853d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,14 +8,9 @@ "useUnknownInCatchVariables": false, "resolveJsonModule": true, "declaration": false, - "lib": ["DOM"] + "lib": ["DOM"], + "skipLibCheck": true }, - "include": [ - "lib/**/*.ts", - "tool/*.ts" - ], - "exclude": [ - "**/*.test.ts", - "lib/src/vendor/dart-sass/**" - ] + "include": ["lib/**/*.ts", "tool/*.ts"], + "exclude": ["**/*.test.ts", "lib/src/vendor/dart-sass/**"] } From 7e8f59a12958283cc9f60ce3fd90787caf91a91f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Israel=20Ortiz=20Garc=C3=ADa?= Date: Thu, 8 Jun 2023 18:30:30 -0700 Subject: [PATCH 2/2] feedback: rewording, revert file that shouldn't have gone through --- lib/src/legacy/importer.ts | 2 +- tsconfig.json | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/src/legacy/importer.ts b/lib/src/legacy/importer.ts index fc14d33b..149c55cf 100644 --- a/lib/src/legacy/importer.ts +++ b/lib/src/legacy/importer.ts @@ -127,7 +127,7 @@ export class LegacyImporterWrapper return null; } else if (!url.startsWith('file:')) { // We'll only search for another relative import when the URL isn't - // canonicalized already. + // absolute. this.expectingRelativeLoad = true; } diff --git a/tsconfig.json b/tsconfig.json index 3b01853d..693fadcb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,9 +8,14 @@ "useUnknownInCatchVariables": false, "resolveJsonModule": true, "declaration": false, - "lib": ["DOM"], - "skipLibCheck": true + "lib": ["DOM"] }, - "include": ["lib/**/*.ts", "tool/*.ts"], - "exclude": ["**/*.test.ts", "lib/src/vendor/dart-sass/**"] + "include": [ + "lib/**/*.ts", + "tool/*.ts" + ], + "exclude": [ + "**/*.test.ts", + "lib/src/vendor/dart-sass/**" + ] }