From b2cdc53104b35f4711ed3dc2dbd5080ed2bfcbf4 Mon Sep 17 00:00:00 2001 From: arggh <> Date: Fri, 23 Jul 2021 13:11:10 +0300 Subject: [PATCH] Fix #8 Return value object's property `code` should hold just the CSS string. This implementation works with both 3.30.0+ and earlier versions of Svelte. --- MelteCompiler.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MelteCompiler.js b/MelteCompiler.js index 8dfabb3..bf3b98c 100644 --- a/MelteCompiler.js +++ b/MelteCompiler.js @@ -346,8 +346,10 @@ SvelteCompiler = class SvelteCompiler extends CachingCompiler { style: async ({ content, attributes }) => { if (this.postcss) { if (attributes.lang == 'postcss') { + const { css: code } = await this.postcss.process(content, { from: undefined }); + return { - code: await this.postcss.process(content, { from: undefined }) + code }; } }