File tree Expand file tree Collapse file tree 3 files changed +18
-16
lines changed Expand file tree Collapse file tree 3 files changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -71,8 +71,6 @@ export class LegacyImporterWrapper<sync extends 'sync' | 'async'>
7171 // the modern API, so we always return `null` in this case.
7272 private expectingRelativeLoad = true ;
7373
74- // TODO: Support prev from a load path
75-
7674 constructor (
7775 private readonly self : LegacyPluginThis ,
7876 private readonly callbacks : Array < LegacyImporter < sync > > ,
@@ -220,6 +218,8 @@ export class LegacyImporterWrapper<sync extends 'sync' | 'async'>
220218 prev : string ,
221219 { fromImport} : { fromImport : boolean }
222220 ) : PromiseOr < LegacyImporterResult , sync > {
221+ assert ( this . callbacks . length > 0 ) ;
222+
223223 const self : LegacyImporterThis = { ...this . self , fromImport} ;
224224 self . options = { ...self . options , context : self } ;
225225
Original file line number Diff line number Diff line change @@ -134,19 +134,21 @@ function convertOptions<sync extends 'sync' | 'async'>(
134134 functions [ signature ] = wrapFunction ( self , callback , sync ) ;
135135 }
136136
137- const importers = options . importer
138- ? [
139- new LegacyImporterWrapper (
140- self ,
141- options . importer instanceof Array
142- ? options . importer
143- : [ options . importer ] ,
144- options . includePaths ?? [ ] ,
145- options . file ?? 'stdin' ,
146- sync
147- ) ,
148- ]
149- : undefined ;
137+ const importers =
138+ options . importer &&
139+ ( ! ( options . importer instanceof Array ) || options . importer . length > 0 )
140+ ? [
141+ new LegacyImporterWrapper (
142+ self ,
143+ options . importer instanceof Array
144+ ? options . importer
145+ : [ options . importer ] ,
146+ options . includePaths ?? [ ] ,
147+ options . file ?? 'stdin' ,
148+ sync
149+ ) ,
150+ ]
151+ : undefined ;
150152
151153 return {
152154 functions,
Original file line number Diff line number Diff line change 11{
22 "name" : " sass-embedded" ,
3- "version" : " 1.49.8 " ,
3+ "version" : " 1.49.9-dev " ,
44 "protocol-version" : " 1.0.0" ,
55 "compiler-version" : " 1.49.8" ,
66 "description" : " Node.js library that communicates with Embedded Dart Sass using the Embedded Sass protocol" ,
You can’t perform that action at this time.
0 commit comments