From 22cf914aade900e84280437fbcfbeb103a267692 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 21 May 2025 13:43:37 -0400 Subject: [PATCH] generate functional output in sandbox --- playgrounds/sandbox/run.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/playgrounds/sandbox/run.js b/playgrounds/sandbox/run.js index 3a62286b24..dd66b2e184 100644 --- a/playgrounds/sandbox/run.js +++ b/playgrounds/sandbox/run.js @@ -85,9 +85,25 @@ for (const generate of /** @type {const} */ (['client', 'server'])) { } write(output_js, compiled.js.code + '\n//# sourceMappingURL=' + path.basename(output_map)); - write(output_map, compiled.js.map.toString()); + // generate with templatingMode: 'functional' + if (generate === 'client') { + const compiled = compile(source, { + dev: true, + filename: input, + generate, + runes: argv.values.runes, + templatingMode: 'functional' + }); + + const output_js = `${cwd}/output/${generate}/${file}.functional.js`; + const output_map = `${cwd}/output/${generate}/${file}.functional.js.map`; + + write(output_js, compiled.js.code + '\n//# sourceMappingURL=' + path.basename(output_map)); + write(output_map, compiled.js.map.toString()); + } + if (compiled.css) { write(output_css, compiled.css.code); }