From 07c79ec59242f48457ff4c0ff949b0697cc8525d Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 16 Jun 2023 14:46:34 +0100 Subject: [PATCH 1/2] Fix fonts not loading in builder preview in dev --- packages/builder/vite.config.js | 36 ++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/packages/builder/vite.config.js b/packages/builder/vite.config.js index ecaedc3cbe..4a0ffca8d4 100644 --- a/packages/builder/vite.config.js +++ b/packages/builder/vite.config.js @@ -12,9 +12,31 @@ const ignoredWarnings = [ "a11y-click-events-have-key-events", ] +const copyFonts = dest => + viteStaticCopy({ + targets: [ + { + src: "../../node_modules/@fontsource/source-sans-pro", + dest, + }, + { + src: "../../node_modules/remixicon/fonts/*", + dest, + }, + ], + }) + export default defineConfig(({ mode }) => { const isProduction = mode === "production" const env = loadEnv(mode, process.cwd()) + + // Plugins to only run in dev + const devOnlyPlugins = [ + // Copy fonts to an additional path so that svelte's automatic + // prefixing of the base URL path can still resolve assets + copyFonts("builder/fonts"), + ] + return { test: { setupFiles: ["./vitest.setup.js"], @@ -60,18 +82,8 @@ export default defineConfig(({ mode }) => { ), "process.env.SENTRY_DSN": JSON.stringify(process.env.SENTRY_DSN), }), - viteStaticCopy({ - targets: [ - { - src: "../../node_modules/@fontsource/source-sans-pro", - dest: isProduction ? "fonts" : "builder/fonts", - }, - { - src: "../../node_modules/remixicon/fonts/*", - dest: isProduction ? "fonts" : "builder/fonts", - }, - ], - }), + copyFonts("fonts"), + ...(isProduction ? [] : devOnlyPlugins), ], optimizeDeps: { exclude: ["@roxi/routify"], From 40c62e82a2bfda47a2d7a967ca6bf7f7bac47ff5 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 19 Jun 2023 07:24:14 +0000 Subject: [PATCH 2/2] Bump version to 2.7.25-alpha.2 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 025b796704..93d75b8518 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.7.25-alpha.1", + "version": "2.7.25-alpha.2", "npmClient": "yarn", "packages": [ "packages/backend-core",