@@ -171,43 +171,26 @@ interface IFileContentAndVersion {
171171 * @public
172172 */
173173export class SassProcessor {
174+ public readonly ignoredFileGlobs : string [ ] | undefined ;
174175 public readonly inputFileGlob : string ;
175176 public readonly sourceFolderPath : string ;
176- public readonly ignoredFileGlobs : string [ ] | undefined ;
177177
178178 // Map of input file path -> record
179179 private readonly _fileInfo : Map < string , IFileRecord > ;
180180 private readonly _resolutions : Map < string , SyncOrAsyncResolution > ;
181181
182182 private readonly _isFileModule : ( filePath : string ) => boolean ;
183183 private readonly _options : ISassProcessorOptions ;
184- private readonly _scssOptions : Options < 'async' > ;
185184 private readonly _realpathSync : ( path : string ) => string ;
185+ private readonly _scssOptions : Options < 'async' > ;
186186
187187 private _configFilePath : string | undefined ;
188188
189189 public constructor ( options : ISassProcessorOptions ) {
190190 const { silenceDeprecations, excludeFiles } = options ;
191191
192- this . _configFilePath = undefined ;
193-
194- this . _fileInfo = new Map ( ) ;
195- this . _resolutions = new Map ( ) ;
196-
197- this . _options = options ;
198-
199- this . _realpathSync = new RealNodeModulePathResolver ( ) . realNodeModulePath ;
200-
201192 const { isFileModule, allFileExtensions } = buildExtensionClassifier ( options ) ;
202193
203- this . inputFileGlob = `**/*+(${ allFileExtensions . join ( '|' ) } )` ;
204- this . sourceFolderPath = options . srcFolder ;
205- this . ignoredFileGlobs = excludeFiles ?. map ( ( excludedFile ) =>
206- excludedFile . startsWith ( './' ) ? excludedFile . slice ( 2 ) : excludedFile
207- ) ;
208-
209- this . _isFileModule = isFileModule ;
210-
211194 const deprecationsToSilence : DeprecationOrId [ ] | undefined = silenceDeprecations
212195 ? Array . from ( silenceDeprecations , ( deprecation ) => {
213196 if ( ! Object . prototype . hasOwnProperty . call ( deprecations , deprecation ) ) {
@@ -239,6 +222,18 @@ export class SassProcessor {
239222 } ;
240223 } ;
241224
225+ this . ignoredFileGlobs = excludeFiles ?. map ( ( excludedFile ) =>
226+ excludedFile . startsWith ( './' ) ? excludedFile . slice ( 2 ) : excludedFile
227+ ) ;
228+ this . inputFileGlob = `**/*+(${ allFileExtensions . join ( '|' ) } )` ;
229+ this . sourceFolderPath = options . srcFolder ;
230+
231+ this . _configFilePath = undefined ;
232+ this . _fileInfo = new Map ( ) ;
233+ this . _isFileModule = isFileModule ;
234+ this . _resolutions = new Map ( ) ;
235+ this . _options = options ;
236+ this . _realpathSync = new RealNodeModulePathResolver ( ) . realNodeModulePath ;
242237 this . _scssOptions = {
243238 style : 'expanded' , // leave minification to clean-css
244239 importers : [
@@ -776,13 +771,13 @@ export class SassProcessor {
776771 ensureFolderExists : true
777772 } ;
778773
779- const promises : Promise < void > [ ] = dtsOutputFolders . map ( ( dtsOutputFolder : string ) => {
780- return FileSystem . writeFileAsync (
774+ for ( const dtsOutputFolder of dtsOutputFolders ) {
775+ await FileSystem . writeFileAsync (
781776 path . resolve ( dtsOutputFolder , `${ relativeFilePath } .d.ts` ) ,
782777 dtsContent ,
783778 writeFileOptions
784779 ) ;
785- } ) ;
780+ }
786781
787782 const filename : string = path . basename ( relativeFilePath ) ;
788783 const extensionStart : number = filename . lastIndexOf ( '.' ) ;
@@ -798,17 +793,15 @@ export class SassProcessor {
798793 const { folder, shimModuleFormat } = cssOutputFolder ;
799794
800795 const cssFilePath : string = path . resolve ( folder , relativeCssPath ) ;
801- promises . push ( FileSystem . writeFileAsync ( cssFilePath , css , writeFileOptions ) ) ;
796+ await FileSystem . writeFileAsync ( cssFilePath , css , writeFileOptions ) ;
802797
803798 if ( shimModuleFormat && ! filename . endsWith ( '.css' ) ) {
804799 const jsFilePath : string = path . resolve ( folder , `${ relativeFilePath } .js` ) ;
805800 const jsShimContent : string = generateJsShimContent ( shimModuleFormat , cssPathFromJs ) ;
806- promises . push ( FileSystem . writeFileAsync ( jsFilePath , jsShimContent , writeFileOptions ) ) ;
801+ await FileSystem . writeFileAsync ( jsFilePath , jsShimContent , writeFileOptions ) ;
807802 }
808803 }
809804 }
810-
811- await Promise . all ( promises ) ;
812805 }
813806
814807 private _createDTS ( moduleMap : JsonObject | undefined ) : string {
0 commit comments