wess09/webapp/electron-builder.config.js
2026-05-06 23:03:50 +08:00

35 lines
781 B
JavaScript

if (process.env.VITE_APP_VERSION === undefined) {
const now = new Date;
process.env.VITE_APP_VERSION = `${now.getUTCFullYear() - 2000}.${now.getUTCMonth() + 1}.${now.getUTCDate()}-${now.getUTCHours() * 60 + now.getUTCMinutes()}`;
}
/**
* @type {import('electron-builder').Configuration}
* @see https://www.electron.build/configuration/configuration
*/
const config = {
directories: {
output: 'dist',
buildResources: 'buildResources',
},
files: [
'packages/**/dist/**',
],
extraMetadata: {
version: process.env.VITE_APP_VERSION,
},
win: {
target: [
{
target: 'portable',
arch: ['x64'],
},
],
},
portable: {
artifactName: '${productName}_Portable_${version}.${ext}',
},
};
module.exports = config;