From 059029d025f8a5659ca278776f9929500221d56b Mon Sep 17 00:00:00 2001 From: Aral Roca Date: Wed, 4 Oct 2023 17:28:46 +0200 Subject: [PATCH] fix: fix i18n and config modules --- docs/02-building-your-application/01-routing/06-middleware.md | 2 +- src/cli/serve.test.tsx | 0 src/constants.ts | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 src/cli/serve.test.tsx diff --git a/docs/02-building-your-application/01-routing/06-middleware.md b/docs/02-building-your-application/01-routing/06-middleware.md index f4684614a..8a8f4b1c4 100644 --- a/docs/02-building-your-application/01-routing/06-middleware.md +++ b/docs/02-building-your-application/01-routing/06-middleware.md @@ -5,7 +5,7 @@ description: Learn how to use Middleware to run code before a request is complet Middleware allows you to run code before a request is completed. Then, based on the incoming request, you can modify the response by rewriting, redirecting, modifying the request or response headers, or responding directly. -Middleware runs before routes are matched. See [Matching Paths](#matching-paths) for more details. +Middleware runs before routes are matched. ## Convention diff --git a/src/cli/serve.test.tsx b/src/cli/serve.test.tsx new file mode 100644 index 000000000..e69de29bb diff --git a/src/constants.ts b/src/constants.ts index fb1ca9f3d..81d5e1586 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -7,9 +7,9 @@ const rootDir = getRootDir(); const srcDir = getRootDir("development"); const PAGE_404 = "/_404"; const PAGE_500 = "/_500"; -const I18N_CONFIG = await importFileIfExists("i18n", rootDir); +const I18N_CONFIG = (await importFileIfExists("i18n", rootDir))?.default; const CONFIG_DIR = path.join(srcDir, ".."); -const CONFIG = (await importFileIfExists("brisa.config", CONFIG_DIR)) ?? {}; +const CONFIG = (await importFileIfExists("brisa.config", CONFIG_DIR))?.default ?? {}; const defaultConfig = { trailingSlash: false,