LegacyAsyncImporter
Legacy Async Importer: ((this: LegacyImporterThis, url: string, prev: string, done: ((result: LegacyImporterResult) => void)) => void)
Type declaration
-
- (this: LegacyImporterThis, url: string, prev: string, done: ((result: LegacyImporterResult) => void)): void
-
Parameters
-
this: LegacyImporterThis
-
url: string
The
@useor@importrule’s URL as a string, exactly as it appears in the stylesheet. -
prev: string
A string identifying the stylesheet that contained the
@useor@import. This string’s format depends on how that stylesheet was loaded:- If the stylesheet was loaded from the filesystem, it’s the absolute path of its file.
- If the stylesheet was loaded from an importer that returned its contents,
it’s the URL of the
@useor@importrule that loaded it. - If the stylesheet came from the data option, it’s the string "stdin".
-
done: ((result: LegacyImporterResult) => void)
The callback to call once the importer has finished running.
-
- (result: LegacyImporterResult): void
-
Parameters
-
result: LegacyImporterResult
Returns void
-
-
Returns void
-
An asynchronous callback that implements custom Sass loading logic for
@importrules and@userules. This can be passed to importer for either render or renderSync.An asynchronous importer must return
undefined, and then calldonewith the result of its LegacyImporterResult once it's done running.See importer for more detailed documentation.
Deprecated
This only works with the legacy render and renderSync APIs. Use Importer with compile, compileString, compileAsync, and compileStringAsync instead.