diff --git a/src/index.ts b/src/index.ts index fb774a2fb7..1caf5b5abc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -60,7 +60,7 @@ async function replaceTagContents(source, type: 'script' | 'style', preprocessor const processed: { code: string, map?: SourceMap | string } = await preprocessor({ content, attributes, - options + filename : options.filename }); if (processed && processed.code) { @@ -80,7 +80,7 @@ export async function preprocess(source: string, options: PreprocessOptions) { if (!!markup) { const processed: { code: string, map?: SourceMap | string } = await markup({ content: source, - options + filename: options.filename }); source = processed.code; } diff --git a/src/interfaces.ts b/src/interfaces.ts index 51b45983ae..f2923c0788 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -86,7 +86,7 @@ export interface PreprocessOptions { markup?: (options: {content: string, options: PreprocessOptions}) => { code: string, map?: SourceMap | string }; style?: Preprocessor; script?: Preprocessor; - id?: string + filename?: string } -export type Preprocessor = (options: {content: string, attributes: Record, options: PreprocessOptions}) => { code: string, map?: SourceMap | string }; +export type Preprocessor = (options: {content: string, attributes: Record, filename?: string}) => { code: string, map?: SourceMap | string };