From 5bb9cf1e7cbb7dd99c1d7cf82791c184a30cee70 Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti <24919330+marcalexiei@users.noreply.github.com> Date: Wed, 11 Dec 2024 13:59:47 +0100 Subject: [PATCH] fix(packages/tuono): styles are not in the page when running `tuono dev` (#220) --- packages/tuono/src/build/index.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/tuono/src/build/index.ts b/packages/tuono/src/build/index.ts index 68c7c1b8..e0e49c86 100644 --- a/packages/tuono/src/build/index.ts +++ b/packages/tuono/src/build/index.ts @@ -32,7 +32,17 @@ function createBaseViteConfigFromTuonoConfig( plugins: [ ...(tuonoConfig.vite?.plugins ?? []), - react(), + + /** + * even if `include` is not a valid option for this + * plugin, we have to use it. + * If not specified, when running `tuono dev`, the mdx + * won't be compiled include any style in the page and it might + * seem broken. + */ + // @ts-expect-error see above comment + react({ include: /\.(jsx|js|mdx|md|tsx|ts)$/ }), + ViteFsRouter(), LazyLoadingPlugin(), ],