From 1847f9ec69b6f7277e5ff142a04cf7ca97c2e902 Mon Sep 17 00:00:00 2001 From: Maxime LUCE Date: Mon, 12 Apr 2021 18:00:38 +0200 Subject: [PATCH] Pass full markup source to preprocessors (#6169) --- site/content/docs/04-compile-time.md | 6 +++--- src/compiler/preprocess/index.ts | 3 ++- src/compiler/preprocess/types.ts | 7 +++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/site/content/docs/04-compile-time.md b/site/content/docs/04-compile-time.md index 755985520d..361c9cdbc4 100644 --- a/site/content/docs/04-compile-time.md +++ b/site/content/docs/04-compile-time.md @@ -199,11 +199,11 @@ result: { code: string, dependencies?: Array }>, - script?: (input: { content: string, attributes: Record, filename: string }) => Promise<{ + script?: (input: { content: string, markup: string, attributes: Record, filename: string }) => Promise<{ code: string, dependencies?: Array }>, - style?: (input: { content: string, attributes: Record, filename: string }) => Promise<{ + style?: (input: { content: string, markup: string, attributes: Record, filename: string }) => Promise<{ code: string, dependencies?: Array }> @@ -242,7 +242,7 @@ const { code } = await svelte.preprocess(source, { --- -The `script` and `style` functions receive the contents of `