File tree Expand file tree Collapse file tree 2 files changed +7
-18
lines changed Expand file tree Collapse file tree 2 files changed +7
-18
lines changed Original file line number Diff line number Diff line change @@ -121,9 +121,9 @@ async function processFile(filename,
121121 return ;
122122 }
123123
124- let type = determineFileType ( sourcePath ) ;
125- if ( type && compactors [ type ] ) {
126- let compactor = compactors [ type ] ;
124+ let fileExtension = path . extname ( sourcePath ) . substr ( 1 ) . toLowerCase ( ) ;
125+ if ( fileExtension && compactors [ fileExtension ] ) {
126+ let compactor = compactors [ fileExtension ] ;
127127 content = await compactor ( content ) ;
128128 }
129129
@@ -134,13 +134,3 @@ async function processFile(filename,
134134 }
135135 return assetManager . writeFile ( targetPath , content , options ) ;
136136}
137-
138- /**
139- * The file type is the lowercase file extension
140- *
141- * @param {string } sourcePath
142- * @returns {string }
143- */
144- function determineFileType ( sourcePath ) {
145- return path . extname ( sourcePath ) . substr ( 1 ) . toLowerCase ( ) ;
146- }
Original file line number Diff line number Diff line change @@ -47,14 +47,13 @@ export interface Compactor {
4747}
4848
4949export interface ProcessFile {
50- ( filename : string , opts : ProcessFileOpts ) : Promise < unknown >
51- }
52-
53- export interface ProcessFileOpts {
5450 source : string ,
5551 target : string ,
56- writeFileOptions : WriteFileOpts ,
52+ targetDir : string ,
53+ fingerprint ?: boolean ,
54+ compactors : CompactorMap ,
5755 assetManager : AssetManager ,
56+ filter ?: ( filename : string ) => boolean
5857}
5958
6059export interface FileFinderOptions {
You can’t perform that action at this time.
0 commit comments