forked from jsnbuchanan/crowd-funder-for-time-pwa
- Replace manual CSS injection hack with Vite plugin - Configure Vite to handle both main process and renderer builds - Update build scripts to work with proper Vite output structure - Remove fix-inject-css.js post-build script - Update BUILDING.md documentation - Add build-modernization-context.md for future reference Technical changes: - vite.config.electron.mts: Add electron-css-injection plugin and proper output config - scripts/build-electron.js: Simplify to work with Vite-generated files - BUILDING.md: Update Electron build documentation - doc/build-modernization-context.md: Document context and decisions Security/maintenance improvements: - Eliminate manual file manipulation hacks - Ensure deterministic, reproducible builds - Centralize build logic in Vite configuration - Improve developer experience and CI/CD compatibility Author: Matthew Raymer
31 lines
735 B
TypeScript
31 lines
735 B
TypeScript
import { defineConfig } from 'vite';
|
|
import vue from '@vitejs/plugin-vue';
|
|
import path from 'path';
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
base: './',
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, 'src'),
|
|
},
|
|
},
|
|
build: {
|
|
outDir: 'dist-electron/www',
|
|
emptyOutDir: false,
|
|
assetsDir: 'assets',
|
|
cssCodeSplit: false,
|
|
rollupOptions: {
|
|
input: path.resolve(__dirname, 'src/main.electron.ts'),
|
|
output: {
|
|
entryFileNames: 'main.electron.js',
|
|
assetFileNames: 'assets/[name]-[hash][extname]',
|
|
chunkFileNames: 'assets/[name]-[hash].js',
|
|
manualChunks: undefined
|
|
}
|
|
},
|
|
commonjsOptions: {
|
|
transformMixedEsModules: true
|
|
}
|
|
}
|
|
});
|