From 62f5673de66665ee66ece45a8a6f450ab7937f73 Mon Sep 17 00:00:00 2001 From: kyvg Date: Tue, 16 Aug 2022 20:51:00 +0300 Subject: [PATCH] fix/resolve-scss-extension --- src/helpers/__tests__/fixtures/tsconfig-paths.module.scss | 2 +- src/helpers/getCssExports.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/helpers/__tests__/fixtures/tsconfig-paths.module.scss b/src/helpers/__tests__/fixtures/tsconfig-paths.module.scss index 0cfe09c..7614442 100644 --- a/src/helpers/__tests__/fixtures/tsconfig-paths.module.scss +++ b/src/helpers/__tests__/fixtures/tsconfig-paths.module.scss @@ -1,2 +1,2 @@ -@import '@scss/_external.module.scss'; +@import '@scss/_external.module'; @import 'alias.scss'; diff --git a/src/helpers/getCssExports.ts b/src/helpers/getCssExports.ts index 00e36e8..69caf10 100644 --- a/src/helpers/getCssExports.ts +++ b/src/helpers/getCssExports.ts @@ -99,7 +99,10 @@ export const getCssExports = ({ const aliasImporter: sass.FileImporter<'sync'> = { findFileUrl(url) { - const newUrl = matchPath !== null ? matchPath(url) : undefined; + const newUrl = + matchPath !== null + ? matchPath(url, undefined, undefined, ['.sass', '.scss']) + : undefined; return newUrl ? new URL(`file://${newUrl}`) : null; }, };