Skip to content

Commit 5d38bf9

Browse files
Update configs
1 parent 73033bb commit 5d38bf9

5 files changed

Lines changed: 58 additions & 25 deletions

File tree

electron-app/forge.config.ts

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { MakerDeb } from '@electron-forge/maker-deb';
2+
import { MakerDMG } from '@electron-forge/maker-dmg';
23
import { MakerSquirrel } from '@electron-forge/maker-squirrel';
34
import { MakerZIP } from '@electron-forge/maker-zip';
45
import { FusesPlugin } from '@electron-forge/plugin-fuses';
@@ -45,10 +46,8 @@ const config: ForgeConfig = {
4546
],
4647
},
4748
makers: [
48-
{
49-
name: '@electron-forge/maker-deb',
50-
platforms: ['linux'],
51-
config: {
49+
new MakerDeb(
50+
{
5251
options: {
5352
bin: 'Swach',
5453
name: 'swach',
@@ -60,18 +59,18 @@ const config: ForgeConfig = {
6059
icon: 'electron-app/resources/icon.png',
6160
},
6261
},
63-
},
64-
{
65-
name: '@electron-forge/maker-dmg',
66-
platforms: ['darwin'],
67-
config(arch) {
62+
['linux'],
63+
),
64+
new MakerDMG(
65+
(arch) => {
6866
return {
6967
name: arch === 'arm64' ? 'Swach-arm64' : 'Swach',
7068
background: 'electron-app/resources/installBackground.png',
7169
icon: 'electron-app/resources/dmg.icns',
7270
};
7371
},
74-
},
72+
['darwin'],
73+
),
7574
// {
7675
// name: '@electron-forge/maker-snap',
7776
// platforms: ['linux'],
@@ -107,18 +106,12 @@ const config: ForgeConfig = {
107106
// type: 'app',
108107
// },
109108
// },
110-
{
111-
name: '@electron-forge/maker-squirrel',
112-
config: {
113-
name: 'Swach',
114-
certificateFile: process.env['WINDOWS_PFX_FILE'],
115-
certificatePassword: process.env['WINDOWS_PFX_PASSWORD'],
116-
},
117-
},
118-
{
119-
name: '@electron-forge/maker-zip',
120-
platforms: ['darwin'],
121-
},
109+
new MakerSquirrel({
110+
name: 'Swach',
111+
certificateFile: process.env['WINDOWS_PFX_FILE'],
112+
certificatePassword: process.env['WINDOWS_PFX_PASSWORD'],
113+
}),
114+
new MakerZIP({}, ['darwin']),
122115
],
123116
plugins: [
124117
new VitePlugin({

electron-app/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"version": "1.2.15",
55
"description": "A robust color management tool for the modern age.",
66
"main": ".vite/build/main.js",
7-
"type": "module",
87
"scripts": {
98
"start": "electron-forge start",
109
"package": "electron-forge package",

electron-app/tsconfig.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ESNext",
4+
"module": "commonjs",
5+
"allowJs": true,
6+
"skipLibCheck": true,
7+
"esModuleInterop": true,
8+
"noImplicitAny": true,
9+
"sourceMap": true,
10+
"baseUrl": ".",
11+
"outDir": "dist",
12+
"moduleResolution": "node",
13+
"resolveJsonModule": true
14+
}
15+
}

vite.main.config.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
import { defineConfig } from 'vite';
22

33
// https://vitejs.dev/config
4-
export default defineConfig({});
4+
export default defineConfig((env) => {
5+
const {
6+
forgeConfigSelf: { entry },
7+
} = env as unknown as { forgeConfigSelf: { entry: string } };
8+
9+
return {
10+
build: {
11+
lib: {
12+
entry,
13+
fileName: () => '[name].js',
14+
formats: ['es'],
15+
},
16+
sourcemap: true,
17+
},
18+
};
19+
});

vite.preload.config.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
import { defineConfig } from 'vite';
22

33
// https://vitejs.dev/config
4-
export default defineConfig({});
4+
export default defineConfig({
5+
build: {
6+
rollupOptions: {
7+
output: {
8+
format: 'esm',
9+
entryFileNames: '[name].mjs',
10+
chunkFileNames: '[name].mjs',
11+
},
12+
},
13+
sourcemap: true,
14+
},
15+
});

0 commit comments

Comments
 (0)