LegacyImporterThis

LegacyImporter 函式上下文中,this 的值。

已棄用

這僅由舊版 renderrenderSync API 使用。請改用 Importer 搭配 compilecompileStringcompileAsynccompileStringAsync

階層

屬性

fromImport: 布林值
相容性
Dart Sass
自 1.33.0 起
Node Sass

指出導入器是否因為 Sass 的 @import 規則而被呼叫,而不是 @use@forward 規則。

這應該*僅*用於判斷是否要載入僅限導入檔案

options: {
    context: LegacyPluginThis;
    data?: 字串;
    file?: 字串;
    includePaths: 字串;
    indentType: 0 | 1;
    indentWidth: 數字;
    linefeed: "\r" | "\r\n" | "\n" | "\n\r";
    precision: 10;
    result: {
        stats: {
            entry: 字串;
            start: 數字;
        };
    };
    style: 1;
}

傳遞給 renderrenderSync 之選項的部分表示。

類型宣告

  • context: LegacyPluginThis

    包含此物件的相同 LegacyPluginThis 實例。

  • 選用 data?: string

    傳遞給 data 的值。

  • 選用 file?: string

    傳遞給 filefile 的值。

  • includePaths: string

    傳遞給 includePaths 的值,在 Windows 上以 ";" 分隔,在其他作業系統上以 ":" 分隔。此值始終包含目前工作目錄作為第一個項目。

  • indentType: 0 | 1

    如果 indentType"tab",則為 1,否則為 0。

  • indentWidth: number

    傳遞給 indentWidth 的值,否則為 2

  • linefeed: "\r" | "\r\n" | "\n" | "\n\r"

    傳遞給 linefeed 的值,否則為 "\n"

  • precision: 10

    永遠是數字 10。

  • result: {
        stats: {
            entry: string;
            start: number;
        };
    }

    一個部分建構的 LegacyResult 物件。

    • stats: {
          entry: string;
          start: number;
      }

      關於編譯進度的部分資訊。

      • entry: string

        如果傳遞了 file,則為其值,否則為字串 "data"

      • start: number

        1970 年 1 月 1 日 00:00:00 UTC 到 Sass 編譯開始時間之間的毫秒數。

  • style: 1

    永遠是數字 1。