LegacySyncImporter
類型宣告
-
- (this: LegacyImporterThis, url: string, prev: string): LegacyImporterResult
-
參數
-
this: LegacyImporterThis
-
url: string
@use
或@import
規則的 URL 字串,與樣式表中顯示的完全相同。 -
prev: string
用於識別包含
@use
或@import
規則的樣式表的字串。此字串的格式取決於該樣式表的載入方式。- 如果樣式表是從檔案系統載入的,則此字串為其檔案的絕對路徑。
- 如果樣式表是從傳回其內容的匯入器載入的,則此字串為載入它的
@use
或@import
規則的 URL。 - 如果樣式表來自 data 選項,則此字串為 "stdin"。
回傳 LegacyImporterResult
-
一個同步回呼函式,它為
@import
規則 和@use
規則 實作自訂的 Sass 載入邏輯。這可以傳遞給 importer,用於 render 或 renderSync。有關更詳細的說明文件,請參閱 importer。
已棄用
這僅適用於舊版 render 和 renderSync API。請改用 Importer 搭配 compile、compileString、compileAsync 和 compileStringAsync。