forked from sircharlo/meeting-media-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
quasar.config.ts
205 lines (194 loc) · 7.26 KB
/
quasar.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
// Configuration for your app
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-file
import { defineConfig } from '#q-app/wrappers';
import { sentryEsbuildPlugin } from '@sentry/esbuild-plugin';
import { sentryVitePlugin } from '@sentry/vite-plugin';
import { fileURLToPath } from 'node:url';
import { mergeConfig } from 'vite'; // use mergeConfig helper to avoid overwriting the default config
import { repository, version } from './package.json';
const IS_BETA = version.includes('beta');
const SENTRY_ORG = 'jw-projects';
const SENTRY_PROJECT = 'mmm-v2';
const SENTRY_VERSION = `meeting-media-manager@${version}`;
const SENTRY_AUTH_TOKEN = process.env.SENTRY_AUTH_TOKEN;
const ENABLE_SOURCE_MAPS =
!!SENTRY_AUTH_TOKEN && process.env.SENTRY_SOURCE_MAPS == 'true';
export default defineConfig((ctx) => {
return {
// animations: 'all', // --- includes all animations
// https://v2.quasar.dev/options/animations
animations: ['fadeIn', 'fadeOut'],
// app boot file (/src/boot)
// --> boot files are part of "main.js"
// https://v2.quasar.dev/quasar-cli-vite/boot-files
boot: ['sentry', 'i18n', 'globals'],
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-file#build
build: {
env: {
isBeta: IS_BETA,
repository: repository.url.replace('.git', ''),
version,
},
extendViteConf(viteConf) {
viteConf.optimizeDeps = mergeConfig(viteConf.optimizeDeps ?? {}, {
esbuildOptions: {
define: {
global: 'window',
},
},
});
if (ctx.prod && !ctx.debug && ENABLE_SOURCE_MAPS) {
viteConf.build = mergeConfig(viteConf.build ?? {}, {
sourcemap: true,
});
if (!viteConf.plugins) viteConf.plugins = [];
viteConf.plugins.push(
sentryVitePlugin({
authToken: SENTRY_AUTH_TOKEN,
org: SENTRY_ORG,
project: SENTRY_PROJECT,
release: { name: SENTRY_VERSION },
telemetry: false,
}),
);
}
},
sourcemap: true,
// See: https://www.electronjs.org/docs/latest/tutorial/electron-timelines#timeline
target: { browser: ['chrome130'], node: 'node20.18.1' },
typescript: {
extendTsConfig: (tsConfig) => {
tsConfig.exclude?.push('./../docs');
},
strict: true,
vueShim: true,
},
vitePlugins: [
[
'@intlify/unplugin-vue-i18n/vite',
{
include: [fileURLToPath(new URL('./src/i18n', import.meta.url))],
ssr: ctx.modeName === 'ssr',
},
],
],
vueRouterMode: 'hash', // available values: 'hash', 'history'
},
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-file#css
css: ['app.scss', 'mmm-icons.css'],
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-file#devServer
devServer: {
// https: true
open: true, // opens browser window automatically
},
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/developing-electron-apps/configuring-electron
electron: {
builder: {
appId: 'sircharlo.meeting-media-manager',
// eslint-disable-next-line no-template-curly-in-string
artifactName: 'meeting-media-manager-${version}-${arch}.${ext}',
generateUpdatesFilesForAllChannels: true,
linux: {
category: 'Utility',
icon: `icons/${IS_BETA ? 'beta' : 'icon'}.png`,
publish: ['github'],
target: 'AppImage',
},
mac: {
extendInfo: {
'com.apple.security.device.audio-input': true,
'com.apple.security.device.camera': true,
'com.apple.security.device.microphone': true,
NSCameraUsageDescription:
"Camera access is required in order to use the website mirroring feature, as screen recording is treated as camera and microphone access. Please note that your device's camera will never be accessed or used in any way by this app.",
NSMicrophoneUsageDescription:
"Microphone access is required in order to use the website mirroring feature, as screen recording is treated as camera and microphone access. Please note that your device's microphone will never be accessed or used in any way by this app.",
},
icon: `icons/${IS_BETA ? 'beta' : 'icon'}.icns`,
minimumSystemVersion: '10.15',
publish: ['github'],
target: { target: 'default' },
},
nsis: { oneClick: false },
portable: {
// eslint-disable-next-line no-template-curly-in-string
artifactName: 'meeting-media-manager-${version}-portable.${ext}',
},
productName: 'Meeting Media Manager',
win: {
icon: `icons/${IS_BETA ? 'beta' : 'icon'}.ico`,
publish: ['github'],
target: [
{ arch: ctx.debug ? 'x64' : ['x64', 'ia32'], target: 'nsis' },
'portable',
],
},
},
bundler: 'builder', // 'packager' or 'builder'
extendElectronMainConf: (esbuildConf) => {
if (ctx.prod && !ctx.debug && ENABLE_SOURCE_MAPS) {
esbuildConf.sourcemap = true;
if (!esbuildConf.plugins) esbuildConf.plugins = [];
esbuildConf.plugins.push(
sentryEsbuildPlugin({
authToken: SENTRY_AUTH_TOKEN,
org: SENTRY_ORG,
project: SENTRY_PROJECT,
release: { name: SENTRY_VERSION },
telemetry: false,
}),
);
}
},
extendElectronPreloadConf: (esbuildConf) => {
if (ctx.prod && !ctx.debug && ENABLE_SOURCE_MAPS) {
esbuildConf.sourcemap = true;
if (!esbuildConf.plugins) esbuildConf.plugins = [];
esbuildConf.plugins.push(
sentryEsbuildPlugin({
authToken: SENTRY_AUTH_TOKEN,
org: SENTRY_ORG,
project: SENTRY_PROJECT,
release: { name: SENTRY_VERSION },
telemetry: false,
}),
);
}
},
extendPackageJson(pkg) {
// All dependencies required by the main and preload scripts need to be listed here
const electronDeps = new Set([
'@numairawan/video-duration',
'@sentry/electron',
'better-sqlite3',
'chokidar',
'countries-and-timezones',
'decompress',
'electron-dl-manager',
'electron-updater',
'fluent-ffmpeg',
'fs-extra',
'heic-convert',
'image-size',
'is-online',
'music-metadata',
'pdfjs-dist',
'upath',
]);
// Remove unneeded dependencies from production build
Object.keys(pkg.dependencies).forEach((dep) => {
if (!electronDeps.has(dep)) {
console.log(`Removing dependency: ${dep}`);
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete pkg.dependencies[dep];
}
});
},
},
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-file#framework
framework: {
config: { dark: 'auto' },
plugins: ['LocalStorage', 'Notify'],
},
};
});