diff --git a/src/autoProcess.ts b/src/autoProcess.ts index 75db9467..684b929c 100644 --- a/src/autoProcess.ts +++ b/src/autoProcess.ts @@ -83,6 +83,7 @@ export function autoPreprocess( ): PreprocessorGroup { markupTagName = markupTagName.toLocaleLowerCase(); + const markupCache: Record = {}; const optionsCache: Record = {}; const transformers = rest.transformers || (rest as Transformers); const markupPattern = new RegExp( @@ -141,7 +142,11 @@ export function autoPreprocess( const transformed = await runTransformer( lang, getTransformerOptions(lang, alias), - { content: stripIndent(content), filename }, + { + content: stripIndent(content), + filename, + markup: markupCache[svelteFile.filename], + }, ); return { @@ -170,7 +175,7 @@ export function autoPreprocess( const transformed = await runTransformer( 'replace', transformers.replace, - { content, filename }, + { content, filename, markup: content }, ); content = transformed.code; @@ -180,6 +185,9 @@ export function autoPreprocess( /** If no