This repository has been archived by the owner on Nov 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
quasar.config.js
227 lines (212 loc) · 7.08 KB
/
quasar.config.js
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
/* eslint-disable @typescript-eslint/no-require-imports */
/* eslint-env node */
/*
* This file runs in a Node context (it's NOT transpiled by Babel), so use only
* the ES6 features that are supported by your Node version. https://node.green/
*/
// Configuration for your app
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js
const { sentryEsbuildPlugin } = require('@sentry/esbuild-plugin');
const { sentryVitePlugin } = require('@sentry/vite-plugin');
const path = require('path');
const { configure } = require('quasar/wrappers');
const { mergeConfig } = require('vite'); // use mergeConfig helper to avoid overwriting the default config
const { version } = require('./package.json');
const devMode = process.env.NODE_ENV === 'development';
module.exports = configure(function (/* ctx */) {
return {
// https://v2.quasar.dev/quasar-cli-vite/prefetch-feature
// preFetch: true,
// https://v2.quasar.dev/options/animations
animations: ['fadeIn', 'fadeOut'],
// https://v2.quasar.dev/quasar-cli-vite/boot-files
boot: ['sentry', 'i18n', 'axios', 'globals'],
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#build
build: {
extendViteConf(viteConf) {
viteConf.optimizeDeps = mergeConfig(viteConf, {
esbuildOptions: {
define: {
global: 'window',
},
},
});
if (!devMode) {
viteConf.build = mergeConfig(viteConf.build, {
sourcemap: true,
});
if (!viteConf.plugins) viteConf.plugins = [];
viteConf.plugins.push(
sentryVitePlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'jw-projects',
project: 'mmm-v2',
release: {
name: version,
},
telemetry: false,
}),
);
}
},
sourcemap: true,
// See: https://www.electronjs.org/docs/latest/tutorial/electron-timelines#timeline
target: { browser: ['chrome128'], node: 'node20' },
vitePlugins: [
[
'@intlify/vite-plugin-vue-i18n',
{
include: path.resolve(__dirname, './src/i18n/**'),
},
],
// [
// 'vite-plugin-checker',
// {
// eslint: {
// lintCommand: 'eslint "./**/*.{js,ts,mjs,cjs,vue}"',
// },
// vueTsc: {
// tsconfigPath: 'tsconfig.vue-tsc.json',
// },
// },
// { server: false },
// ],
],
vueRouterMode: 'hash', // available values: 'hash', 'history'
},
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
css: ['app.scss', 'mmm-icons.css'],
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#sourcefiles
// sourceFiles: {
// rootComponent: 'src/App.vue',
// router: 'src/router/index',
// store: 'src/store/index',
// registerServiceWorker: 'src-pwa/register-service-worker',
// serviceWorker: 'src-pwa/custom-service-worker',
// pwaManifestFile: 'src-pwa/manifest.json',
// electronMain: 'src-electron/electron-main',
// electronPreload: 'src-electron/electron-preload'
// },
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#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}.${ext}',
generateUpdatesFilesForAllChannels: true,
linux: {
category: 'Utility',
icon: 'icons/icon.png',
publish: ['github'],
target: 'AppImage',
},
mac: {
icon: 'icons/icon.icns',
// mergeASARs: false,
publish: ['github'],
target: {
arch: ['universal'],
target: 'dmg',
},
},
nsis: {
// eslint-disable-next-line no-template-curly-in-string
artifactName: 'meeting-media-manager-${version}-${arch}.${ext}',
oneClick: false,
},
productName: 'Meeting Media Manager',
win: {
// asar: false,
icon: 'icons/icon.ico',
publish: ['github'],
target: [
{
arch: ['x64', 'ia32'],
target: 'nsis',
},
],
},
},
bundler: 'builder', // 'packager' or 'builder'
extendElectronMainConf: (esbuildConf) => {
if (!devMode) {
esbuildConf.sourcemap = true;
if (!esbuildConf.plugins) esbuildConf.plugins = [];
esbuildConf.plugins.push(
sentryEsbuildPlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'jw-projects',
project: 'mmm-v2',
release: {
name: version,
},
telemetry: false,
}),
);
}
},
extendElectronPreloadConf: (esbuildConf) => {
if (!devMode) {
esbuildConf.sourcemap = true;
if (!esbuildConf.plugins) esbuildConf.plugins = [];
esbuildConf.plugins.push(
sentryEsbuildPlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'jw-projects',
project: 'mmm-v2',
release: {
name: version,
},
telemetry: false,
}),
);
}
},
extendPackageJson(pkg) {
const requiredNonUiElectronDependencies = [
'@electron/remote',
'@sentry/electron',
'adm-zip',
'better-sqlite3',
'electron-updater',
'electron-window-state',
'fs-extra',
'heic-convert',
'klaw-sync',
'music-metadata',
'pdfjs-dist',
'upath',
];
// Remove unneeded dependencies from production build
Object.keys(pkg.dependencies).forEach((dep) => {
if (!requiredNonUiElectronDependencies.includes(dep)) {
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete pkg.dependencies[dep];
}
});
},
inspectPort: 5858,
},
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework
framework: {
config: {
dark: 'auto',
},
// iconSet: 'material-icons', // Quasar icon set
// lang: 'en-US', // Quasar language pack
// For special cases outside of where the auto-import strategy can have an impact
// (like functional components as one of the examples),
// you can manually specify Quasar components/directives to be available everywhere:
//
// components: [],
// directives: [],
// Quasar plugins
plugins: ['LocalStorage', 'Notify'],
},
};
});