diff --git a/src/compiler/preprocess/index.ts b/src/compiler/preprocess/index.ts index 16bcdf1687..e66fb4ba14 100644 --- a/src/compiler/preprocess/index.ts +++ b/src/compiler/preprocess/index.ts @@ -139,7 +139,7 @@ async function process_tag( preprocessor: Preprocessor, source: Source ): Promise { - const { filename } = source; + const { filename, source: markup } = source; const tag_regex = tag_name === 'style' ? /|([^]*?)<\/style>|\/>)/gi @@ -160,6 +160,7 @@ async function process_tag( const processed = await preprocessor({ content: content || '', attributes: parse_tag_attributes(attributes || ''), + markup, filename }); diff --git a/src/compiler/preprocess/types.ts b/src/compiler/preprocess/types.ts index 06890ad7b5..b65f85c6c8 100644 --- a/src/compiler/preprocess/types.ts +++ b/src/compiler/preprocess/types.ts @@ -22,6 +22,7 @@ export type MarkupPreprocessor = (options: { export type Preprocessor = (options: { content: string; attributes: Record; + markup: string; filename?: string; }) => Processed | Promise;