From f0ac437df915a9b8cbb0c69efc64575716c00e8e Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Tue, 17 Dec 2024 08:49:31 +0900 Subject: [PATCH] chore: comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 翠 / green --- packages/vite/src/node/plugins/css.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/vite/src/node/plugins/css.ts b/packages/vite/src/node/plugins/css.ts index 5e09c5582e1025..d604b2adcdafee 100644 --- a/packages/vite/src/node/plugins/css.ts +++ b/packages/vite/src/node/plugins/css.ts @@ -2376,6 +2376,11 @@ const makeModernScssWorker = ( const resolved = await internalCanonicalize(url, importer) if ( resolved && + // only limit to these extensions because: + // - for the `@import`/`@use`s written in file loaded by `load` function, + // the `canonicalize` function of that `importer` is called first + // - the `load` function of an importer is only called for the importer + // that returned a non-null result from its `canonicalize` function (resolved.endsWith('.css') || resolved.endsWith('.scss') || resolved.endsWith('.sass'))