From c5ec383dc4bb22233a1a79eb7f7bc12ec5f0412d Mon Sep 17 00:00:00 2001 From: RSamaium Date: Tue, 10 Oct 2023 17:12:13 +0200 Subject: [PATCH] 4.1.0 --- packages/compiler/src/build/client-config.ts | 19 ++++++++++++++++--- .../src/build/vite-plugin-tmx-tsx-mover.ts | 1 + 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/packages/compiler/src/build/client-config.ts b/packages/compiler/src/build/client-config.ts index 211a87f4..b1445f5d 100644 --- a/packages/compiler/src/build/client-config.ts +++ b/packages/compiler/src/build/client-config.ts @@ -370,6 +370,19 @@ export async function clientBuildConfig(dirname: string, options: ClientBuildCon } } + const external: string[] = [] + + if (libMode) { + external.push('vue') + } + + if (!hasReact) { + external.push('react', 'react-dom/client') + } + + if (vite?.build?.external) { + external.push(...vite.build.external) + } const viteConfig = { mode: options.mode || 'development', @@ -411,16 +424,16 @@ export async function clientBuildConfig(dirname: string, options: ClientBuildCon !isServer ? nodePolyfills() as any : null ], ...(libMode ? { - external: ['vue'] + external } : { input: { main: plugin ? plugin.entry : !isServer ? resolve(dirname, 'index.html') : entryPointServer() - }, - external: !hasReact ? ['react', 'react-dom/client'] : [] + } }), + external }, ...moreBuildOptions }, diff --git a/packages/compiler/src/build/vite-plugin-tmx-tsx-mover.ts b/packages/compiler/src/build/vite-plugin-tmx-tsx-mover.ts index 1a291b54..c5e3b5d1 100644 --- a/packages/compiler/src/build/vite-plugin-tmx-tsx-mover.ts +++ b/packages/compiler/src/build/vite-plugin-tmx-tsx-mover.ts @@ -8,6 +8,7 @@ const moveTMXTSXFiles = async (outputDir: string): Promise => { const files = globFiles('@(tmx|tsx)') for (const file of files) { + if (file.includes('gui')) continue; const target = path.join(assetDir, path.basename(file)); await fs.copy(file, target, { overwrite: true }); }