2
0
mirror of https://github.com/frappe/books.git synced 2024-11-08 06:44:06 +00:00

Build config changed from .ts to .mjs to fix contents not being used properly

This commit is contained in:
Isaac GC 2024-02-06 20:17:04 -08:00
parent dd7cb43abc
commit d4b6c0d4f6
2 changed files with 22 additions and 9 deletions

View File

@ -8,6 +8,7 @@ import * as vite from 'vite';
import { getMainProcessCommonConfig } from './helpers.mjs';
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
import frappeBooksConfig from '../../electron-builder-config.mjs';
const dirname = path.dirname(fileURLToPath(import.meta.url));
const root = path.join(dirname, '..', '..');
@ -153,12 +154,10 @@ async function packageApp() {
delete builderArgs[opt];
}
let buildOptions = {
config: {
directories: { output: packageDirPath, app: buildDirPath },
files: ['**'],
extends: null,
},
config: frappeBooksConfig,
...builderArgs,
};

View File

@ -1,4 +1,6 @@
import type { Configuration } from 'electron-builder';
// App is tagged with a .mjs extension to allow
import path from 'path';
import { fileURLToPath } from 'url';
/**
* electron-builder doesn't look for the APPLE_TEAM_ID environment variable for some reason.
@ -6,7 +8,13 @@ import type { Configuration } from 'electron-builder';
* collection. See: https://github.com/electron-userland/electron-builder/issues/7812
*/
const config: Configuration = {
const dirname = path.dirname(fileURLToPath(import.meta.url));
// const root = path.join(dirname, '..', '..');
const root = dirname; // redundant, but is meant to keep with the previous line
const buildDirPath = path.join(root, 'dist_electron', 'build');
const packageDirPath = path.join(root, 'dist_electron', 'bundled');
const frappeBooksConfig = {
productName: 'Frappe Books',
appId: 'io.frappe.books',
asarUnpack: '**/*.node',
@ -15,6 +23,12 @@ const config: Configuration = {
{ from: 'translations', to: '../translations' },
{ from: 'templates', to: '../templates' },
],
files: '**',
extends: null,
directories: {
output: packageDirPath,
app: buildDirPath,
},
mac: {
type: 'distribution',
category: 'public.app-category.finance',
@ -34,7 +48,7 @@ const config: Configuration = {
signDlls: true,
icon: 'build/icon.ico',
publish: ['github'],
target: ['portable', 'nsis'],
target: ['nsis', 'portable'],
},
nsis: {
oneClick: false,
@ -52,4 +66,4 @@ const config: Configuration = {
},
};
export default config;
export default frappeBooksConfig;