@@ -30,7 +30,7 @@ class PreprocessResult implements Source {
30
30
31
31
get_location : ReturnType < typeof getLocator > ;
32
32
33
- constructor ( public source : string , public filename : string ) {
33
+ constructor ( public source : string , public filename ? : string ) {
34
34
this . update_source ( { string : source } ) ;
35
35
36
36
// preprocess source must be relative to itself or equal null
@@ -179,10 +179,10 @@ async function process_tag(
179
179
return { string, map, dependencies } ;
180
180
}
181
181
182
- async function process_markup ( filename : string , process : MarkupPreprocessor , source : Source ) {
182
+ async function process_markup ( process : MarkupPreprocessor , source : Source ) {
183
183
const processed = await process ( {
184
184
content : source . source ,
185
- filename
185
+ filename : source . filename
186
186
} ) ;
187
187
188
188
if ( processed ) {
@@ -206,8 +206,7 @@ export default async function preprocess(
206
206
preprocessor : PreprocessorGroup | PreprocessorGroup [ ] ,
207
207
options ?: { filename ?: string }
208
208
) : Promise < Processed > {
209
- // @ts -ignore todo: doublecheck
210
- const filename = ( options && options . filename ) || preprocessor . filename ; // legacy
209
+ const filename : string | undefined = ( options && options . filename ) || ( preprocessor as any ) . filename ; // legacy
211
210
212
211
const preprocessors = preprocessor ? ( Array . isArray ( preprocessor ) ? preprocessor : [ preprocessor ] ) : [ ] ;
213
212
@@ -221,7 +220,7 @@ export default async function preprocess(
221
220
// to make debugging easier = detect low-resolution sourcemaps in fn combine_mappings
222
221
223
222
for ( const process of markup ) {
224
- result . update_source ( await process_markup ( filename , process , result ) ) ;
223
+ result . update_source ( await process_markup ( process , result ) ) ;
225
224
}
226
225
227
226
for ( const process of script ) {
0 commit comments