mirror of
https://github.com/hanzo-studio/studio-desktop.git
synced 2026-10-30 18:54:12 +00:00
* Sort imports with prettier * sort imports * Add as dev dependency * Apply separation * nit
34 lines
966 B
TypeScript
34 lines
966 B
TypeScript
import type { UserConfig } from 'vite';
|
|
import { defineConfig, mergeConfig } from 'vite';
|
|
|
|
import { external, getBuildConfig } from './vite.base.config';
|
|
|
|
// https://vitejs.dev/config
|
|
export default defineConfig((env) => {
|
|
const config: UserConfig = {
|
|
build: {
|
|
rollupOptions: {
|
|
external,
|
|
// Preload scripts may contain Web assets, so use the `build.rollupOptions.input` instead `build.lib.entry`.
|
|
input: './src/preload.ts',
|
|
output: {
|
|
format: 'cjs',
|
|
// It should not be split chunks.
|
|
inlineDynamicImports: true,
|
|
entryFileNames: '[name].cjs',
|
|
chunkFileNames: '[name].cjs',
|
|
assetFileNames: '[name].[ext]',
|
|
},
|
|
},
|
|
},
|
|
// TODO: Not impl. - placeholder for vitest configuration
|
|
test: {
|
|
name: 'preload',
|
|
include: ['tests/preload/**/*'],
|
|
environment: 'jsdom',
|
|
},
|
|
};
|
|
|
|
return mergeConfig(getBuildConfig(env), config);
|
|
});
|