Skip to content

Commit

Permalink
4.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
RSamaium committed Oct 10, 2023
1 parent cc959a8 commit c5ec383
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
19 changes: 16 additions & 3 deletions packages/compiler/src/build/client-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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
},
Expand Down
1 change: 1 addition & 0 deletions packages/compiler/src/build/vite-plugin-tmx-tsx-mover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const moveTMXTSXFiles = async (outputDir: string): Promise<void> => {
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 });
}
Expand Down

0 comments on commit c5ec383

Please sign in to comment.